<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Sercan GEZER | Linux/DevOps Sistem Mühendisi 🇹🇷</title>
 <subtitle>Linux/DevOps konularında Türk Bilişim topluluğuna küçük bir katkı amacıyla oluşturulmuş bir blog.</subtitle>
 <link href="https://www.sercangezer.com.tr/atom.xml" rel="self"/>
 <link href="https://www.sercangezer.com.tr/"/>
 <updated>2026-01-03T12:40:35+03:00</updated>
 <id>https://www.sercangezer.com.tr</id>
 <author>
   <name>Sercan GEZER</name>
   <email>sercan.gezer.tr@gmail.com</email>
 </author>
 <category term="Linux"/>
 <category term="Kubernetes"/>
 <category term="DevOps"/>
 <category term="Docker"/>
 <category term="Shell Script"/>
 
 <entry>
   <title>SSH ve SCP komutlarında JUMPSERVER kullanımı</title>
   <summary>SSH ve SCP komutlarında JUMPSERVER kullanımı</summary>
   <link href="https://www.sercangezer.com.tr/2024/ssh-ve-scp-jumpserver-kullanimi"/>
   <updated>2024-10-12T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2024/SSH-ve-SCP-Jumpserver-kullanimi</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2024/20241012-SSH-ve-SCP-Jumpserver-kullanimi.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Genellikle büyük organizasyonlarda güvenliği sağlamak için her sunucuya bağlanan bir &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;terminal/gateway/jumpserver&lt;/code&gt; vardır. Önce bu sunucuya bağlanıp daha sonra bağlanmak istediğimiz sunucuya SSH atarız.&lt;/p&gt;

&lt;p&gt;Bu iş yükünden kurtulmak için &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SSH&lt;/code&gt; ve &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SCP&lt;/code&gt; nin kendi parametrelerini kullanabiliriz.&lt;/p&gt;

&lt;h2 id=&quot;ssh-bağlantısı-için-jumpserver-kullanmak&quot;&gt;SSH bağlantısı için JumpServer kullanmak;&lt;/h2&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;
ssh &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-J&lt;/span&gt; JUMPSERVER_USER@JUMPSERVER_IP HEDEF_KULLANICI@HEDEF_IP

&lt;span class=&quot;c&quot;&gt;# Örnek&lt;/span&gt;
ssh &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-J&lt;/span&gt; sercangezer@192.168.1.10 sercangezer@10.10.10.20
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-A&lt;/code&gt;.: SSH bağlantısı üzerinden kimlik doğrulaması için &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Agent Forwarding&lt;/code&gt; özelliğini etkinleştirir. Bu özellik, ilk bağlantıda kullanılan kimlik doğrulama anahtarının ikinci bağlantıya iletilmesini sağlar. Böylece, ara sunucuya erişirken yerel anahtarları kullanmaya devam edebilirsiniz.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-J sercangezer@192.168.1.10&lt;/code&gt;: Bu parametre, “Jump Host” veya “ProxyJump” olarak bilinir. İlk olarak, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sercangezer@192.168.1.10&lt;/code&gt; adresine bağlanır ve bu sunucu üzerinden ikinci hedef olan &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sercangezer@10.10.10.20&lt;/code&gt; sunucusuna geçiş yapar. Yani, doğrudan 10.10.10.20 adresine erişiminiz yoksa veya erişim sınırlıysa, 192.168.1.10 üzerinden geçerek erişimi mümkün kılar.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;scp-bağlantısı-için-jumpserver-kullanmak&quot;&gt;SCP bağlantısı için JumpServer kullanmak;&lt;/h2&gt;

&lt;h3 id=&quot;uzak-sunucuya-dosya-kopyalamak-için&quot;&gt;Uzak sunucuya dosya kopyalamak için&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;scp &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ProxyJump&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;sercangezer@192.168.1.10 local_dosya sercangezer@10.10.10.20:~
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scp&lt;/code&gt;: Güvenli dosya kopyalama komutudur. SSH protokolünü kullanarak dosyaları yerel sistem ile uzak sistem arasında kopyalar.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-o ProxyJump=sercangezer@192.168.1.10&lt;/code&gt;: Bu parametre, 192.168.1.10 IP adresindeki sunucuyu proxy olarak kullanır. İlk önce bu sunucuya bağlanır, ardından ikinci sunucuya geçiş yapar. sercangezer kullanıcı adıyla ilk sunucuya bağlanılacaktır.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;local_dosya&lt;/code&gt;: Kopyalanmak istenen yerel dosyanın adıdır.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sercangezer@10.10.10.20:~&lt;/code&gt;: Dosyanın kopyalanacağı uzak sunucunun bilgilerini içerir. Burada sercangezer kullanıcı adı ile 10.10.10.20 IP adresindeki sunucuda kullanıcının ana dizinine (~) kopyalanacaktır.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;uzak-sunucudan-kendi-sunucunuza-dosya-kopyalamak-için&quot;&gt;Uzak sunucudan kendi sunucunuza dosya kopyalamak için&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;scp &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ProxyJump&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;sercangezer@192.168.1.10 sercangezer@10.10.10.20:uzak_dosya_yolu yerel_yol
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scp&lt;/code&gt;: Güvenli dosya kopyalama komutudur.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-o ProxyJump=sercangezer@192.168.1.10&lt;/code&gt;: Bu parametre, dosya kopyalama işlemini yaparken 192.168.1.10 IP adresindeki sunucuyu proxy olarak kullanır.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sercangezer@10.10.10.20:uzak_dosya_yolu&lt;/code&gt;: Kopyalanacak dosyanın uzak sunucudaki konumunu gösterir. sercangezer kullanıcı adı ile 10.10.10.20 sunucusuna erişilir ve uzak_dosya_yolu adlı dosya kopyalanır.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yerel_yol&lt;/code&gt;: Uzak dosyanın kopyalanacağı yerel sistemdeki hedef yolu belirtir.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Kubernetes üzerinde Nexus Repository kurulum</title>
   <summary>Single node Kubernetes üzerinde hostpath olarak Nexus Repository kurulum</summary>
   <link href="https://www.sercangezer.com.tr/2024/kubernetes-uzerinde-nexus-repository-kurulum"/>
   <updated>2024-08-07T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2024/Kubernetes-uzerinde-Nexus-Repository-kurulum</id>
   <content type="html">&lt;h2 id=&quot;video&quot;&gt;Video&lt;/h2&gt;

&lt;div align=&quot;center&quot;&gt;
&lt;iframe class=&quot;youtube-video&quot; src=&quot;https://www.youtube.com/embed/jTb4EzwduHk?si=p3MJmCziQEAy4Zsz&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;../images/2024/20240807-sonatype-nexus-repository-logo.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Private Registry olarak çok yaygın kullanılan &lt;a href=&quot;https://help.sonatype.com/en/sonatype-product-overview.html&quot;&gt;Sonatype Nexus Repository&lt;/a&gt; yazılımını k3s üzerine hostPath olarak kuracağız.&lt;/p&gt;

&lt;p&gt;❗ &lt;a href=&quot;https://github.com/sercangezer/sercangezer.github.io/tree/main/YOUTUBE/00-NexusInstallation&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Github&lt;/code&gt; Kubernetes Manifest dosyaları&lt;/a&gt;&lt;/p&gt;

&lt;h1 id=&quot;kurulum&quot;&gt;Kurulum&lt;/h1&gt;

&lt;ol&gt;
  &lt;li&gt;Öncelikle bir kubernetes kurulu sunucunuz olmalı. Ben k3s kurulu bir tek makine (single node) kullanacağım.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;❗❗ Master &amp;amp; Worker lı bir multi node cluster ınız varsa hostPath sıkıntı çıkaracaktır. Dinamik provision kullanmanız gerekir.&lt;/p&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;vagrant@server-0:~&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;k get node &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; wide

NAME       STATUS   ROLES                  AGE   VERSION        INTERNAL-IP     EXTERNAL-IP     OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME
server-0   Ready    control-plane,master   15m   v1.29.5+k3s1   192.168.1.170   192.168.1.170   Ubuntu 20.04.6 LTS   5.4.0-169-generic   containerd://1.7.15-k3s1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hostPath&lt;/code&gt; ile statik provision yapacağımız için verileri koyacağımız klasörü oluşturup yetki vermemiz gerekiyor.&lt;/li&gt;
&lt;/ol&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;# klasör oluşturuyoruz&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; /nexus-data
&lt;span class=&quot;c&quot;&gt;# klasörün sahipliğini kullanıcımız ile değiştiriyoruz.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo chown &lt;/span&gt;vagrant:vagrant &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; /nexus-data
&lt;span class=&quot;c&quot;&gt;# klasöre okuma yazma ve çalıştırma izinleri veriyoruz&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo chmod&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; 777 /nexus-data
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;namespace imizi oluşturalım.&lt;/li&gt;
&lt;/ol&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;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; | kubectl apply -f -
apiVersion: v1
kind: Namespace
metadata:
  name: nexus
  labels:
    name: nexus
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Nexus’a verilerini nereye yazacağını göstereceğimiz PV ve PVC objelerini oluşturalım.&lt;/li&gt;
&lt;/ol&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;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; | kubectl apply -f -
apiVersion: v1
kind: PersistentVolume
metadata:
  name: nexus-pv
  labels:
    pv: nexus-pv
    type: local
spec:
  capacity:
    storage: 30Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: &quot;&quot;
  hostPath:
    path: /nexus-data
  claimRef:
    name: nexus-pvc
    namespace: nexus
--- 
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: nexus-pvc
  namespace: nexus
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: &quot;&quot;
  resources:
    requests:
      storage: 30Gi
  volumeName: nexus-pv
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Nexus yazılımımızı deploy edeilim.&lt;/li&gt;
&lt;/ol&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;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nexus
  namespace: nexus
  labels:
    app: nexus
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nexus
  template:
    metadata:
      labels:
        app: nexus
    spec:
      containers:
        - name: nexus
          image: sonatype/nexus3:latest
          env:
          - name: MAX_HEAP
            value: &quot;1000m&quot;
          - name: MIN_HEAP
            value: &quot;500m&quot;
          ports:
            - containerPort: 8081
          volumeMounts:
            - name: nexus-data
              mountPath: /nexus-data
      volumes:
        - name: nexus-data
          persistentVolumeClaim:
            claimName: nexus-pvc
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Nexus Web arayüzüne erişebilmek ve yeni oluşturacağımız repoların portlarını yazacağımız servis objemiz.&lt;/li&gt;
&lt;/ol&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;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
  name: nexus-service
  namespace: nexus
spec:
  selector: 
    app: nexus
  type: NodePort  
  ports:
    - name: nexus-web-ui
      port: 8081
      targetPort: 8081
      nodePort: 30880
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;http://NODE_IP:30880 portu üzerinden arayüze erişebilirsiniz.&lt;/li&gt;
  &lt;li&gt;Başlangıçta &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; kullancısının şifresini aşağıdaki komut çıktısı ile öğrenip değiştirmeniz gerekiyor.&lt;/li&gt;
&lt;/ol&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;kubectl &lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; nexus &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;kubectl get pods &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;app=nexus&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;jsonpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;{.items[0].metadata.name}&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /nexus-data/admin.password

&lt;span class=&quot;c&quot;&gt;#Output&lt;/span&gt;
e65a4996-f05b-4294-96a3-24f8fe2d45a8
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Esen kalın …&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Linux PS1 de GIT branch gösterme</title>
   <summary>Linux işletim sistemlerinde BASH PS1 de GIT branch gösterme</summary>
   <link href="https://www.sercangezer.com.tr/2024/linux-ps1-de-git-branch-gosterme"/>
   <updated>2024-05-09T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2024/Linux-PS1-de-git-branch-gosterme</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Düz &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BASH&lt;/code&gt; kullanan biri olarak github repository klasörlerine girdiğimizde hangi branch de olduğunu PS1 ile görmemizi sağlayan küçük bir kod bloğu kullanıyorum.&lt;/p&gt;

&lt;p&gt;İnternet aleminde kalıcı olması amacıyla not ediyorum.&lt;/p&gt;

&lt;p&gt;❗ &lt;a href=&quot;https://git-scm.com/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Git&lt;/code&gt;&lt;/a&gt; yüklü olması gerekiyor.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt; dosyasının en başına aşağıdaki kodu ekleyelim.&lt;/li&gt;
&lt;/ul&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;parse_git_branch&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
     git branch 2&amp;gt; /dev/null | &lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;/^[^*]/d&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;s/* \(.*\)/(\1)/&apos;&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;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;export PS1=&lt;/code&gt; değişkenine aşağıdaki tanımı eklemeniz gerekiyor.&lt;/li&gt;
&lt;/ul&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;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;parse_git_branch&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Kendi &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PS1&lt;/code&gt; değişkenimi paylaşıyorum.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PS1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\[\e&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[01;33m&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\]\u\[\e&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[m&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\]&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\[\e&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[0;1;92m&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\]\h\[\e&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[m&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\]\[\e&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[01;35m&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\]&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(hostname -I | awk &apos;{print &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;1}&apos;)]&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\[\e&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[0m&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\]&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\[\e&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[01;36m&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\]\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;PWD&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\[\e&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[m&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\]\[\e&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[91m&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\]\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(parse_git_branch) &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\[\e&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[01;31m&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\]\\&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$&amp;gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\[\e&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[m&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\]&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# sercangezer@TTK[192.168.1.68]:/GIT/sercangezer.com.tr(main) $&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>SSHFS ile uzak sunucudaki klasörleri baglama</title>
   <summary>SSHFS ile NFS gibi ağ üzerinden klasör ve dosyalara erişme</summary>
   <link href="https://www.sercangezer.com.tr/2024/sshfs-ile-sunucudaki-dosyalara-erisme"/>
   <updated>2024-03-14T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2024/SSHFS-ile-sunucudaki-dosyalara-erisme</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;İş yerindeki bilgisayarıma eve getirdiğimde kendi bilgisayarımdan bu makinedeki dosyalara erişme ihtiyacım oldu.NFS, USB kopyalama gibi meşakatli işlerle dosyaları transfer edebilirdim ama uğraşmak zor geldi açıkcası. Bu çabayı vermemek için; bu işlemleri SSH üzerinden yapan bir client yazmışlar. Bknz: &lt;a href=&quot;https://github.com/libfuse/sshfs&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sshfs&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Öncelikle gerekli paketleri kuralım. (Ben Fedora39 kullanıyorum.)&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo &lt;/span&gt;dnf &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;ntfs-3g fuse sshfs &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;❗ Uzak makinede SSH servisi aktif olması gerekiyor.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Aşağıdaki tarzda bir söz dizimi var.&lt;/li&gt;
&lt;/ul&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;sshfs &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;user]@[hostname&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;:[directory] mountpoint

&lt;span class=&quot;c&quot;&gt;# user: kullanıcı adı&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# hostname: IP yada FQDN&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# directory: Bağlanacağınız sunucudaki klasörün yolu&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# mountpoint: Kendi makinenizdeki bağlayacağınız klasör&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Kendi makinemizde erişeceğimiz klasörü oluşturuyoruz.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; /work/VMs-ISOs

&lt;span class=&quot;c&quot;&gt;# Yetki ve sahiplik vermemiz gerekebilir.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo chmod &lt;/span&gt;777 &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; /work/VMs-ISOs
&lt;span class=&quot;nb&quot;&gt;sudo chown &lt;/span&gt;sercangezer:sercangezer &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; /work/VMs-ISOs

&lt;span class=&quot;c&quot;&gt;# SSHFS ile bağlayalım&lt;/span&gt;
sshfs &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; default_permissions sercangezer@192.168.1.187:/VMs-ISOs /work/VMs-ISOs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Size şifre sorabilir ilk kez bağlanıyorsanız, ardından &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;df -hT&lt;/code&gt; ile bağlandığını görebiliriz.&lt;/li&gt;
&lt;/ul&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;sercangezer@|192.168.1.31|:/home/sercangezer &lt;span class=&quot;nv&quot;&gt;$&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;df&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-hT&lt;/span&gt;
Filesystem                          Type        Size  Used Avail Use% Mounted on
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
sercangezer@192.168.1.187:/VMs-ISOs fuse.sshfs  953G  724G  226G  77% /work/VMs-ISOs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Kalıcı olarak bağlamak istiyorsanız &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/fstab&lt;/code&gt; dosyasına yazmamız gerekiyor. (Bunu pek önermiyorum.)&lt;/li&gt;
&lt;/ul&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;sercangezer@|192.168.1.31|:/home/sercangezer &lt;span class=&quot;nv&quot;&gt;$&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /etc/fstab
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
sercangezer@192.168.1.187:~/ /work/VMs-ISOs fuse.sshfs noauto,x-systemd.automount,_netdev,reconnect,identityfile&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/home/sercangezer/.ssh/id_rsa,allow_other,default_permissions 0 0

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

&lt;p&gt;Artık klasörlere ve dosyalara direkt dosya yöneticisi üzerinden kendi bilgisayarınızdaymış gibi erişebilirsiniz. Tek komutla basit bir çözüm..&lt;/p&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Docker container ile HOST üzerinde linux komutları çalıştırma</title>
   <summary>Docker container ile linux komutları çalıştırma</summary>
   <link href="https://www.sercangezer.com.tr/2024/docker-container-ile-linux-komutlari-calistirma"/>
   <updated>2024-03-07T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2024/docker-container-ile-linux-komutlari-calistirma</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Docker compose ile ayağa kaldırılan bir uygulamanın birkaç servisinin belli aralıklarla yeniden başlatmam gereken bir ihtiyaç ortaya çıktı.&lt;/p&gt;

&lt;p&gt;Bir Linux sever olarak direkt cron olarak bir job yazmaya yönelmek istesemde müşteri bunu compose içerisinden yönetilmesini istedi.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;command:&lt;/code&gt; argümanlarını değiştirerek istediğiniz komutları çalıştırabilirsiniz. &lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&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;version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;3&apos;&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;app&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;s&quot;&gt;nginx:alpine&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ports&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;80:80&quot;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;unless-stopped&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;restarter&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;restarter&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;s&quot;&gt;docker:cli&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&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;/var/run/docker.sock:/var/run/docker.sock&quot;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# direkt docker &lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;command&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;/bin/sh&quot;&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;-c&quot;&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;while&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;true;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sleep&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;10;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$$(date&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;+&apos;%Y-%m-%d&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%H:%M&apos;)&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;yeniden&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;başlatıldı.;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;docker&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;app;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;done&quot;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# docker-compose içerisinde&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#command: [&quot;/bin/sh&quot;, &quot;-c&quot;, &quot;while true; do sleep 10; echo $$(date +&apos;%Y-%m-%d %H:%M&apos;) - app yeniden başlatıldı.; docker compose -p uygulamam restart app; done&quot;]&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;unless-stopped&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Çıktısı&lt;/li&gt;
&lt;/ul&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;sercangezer@TTK|192.168.1.221|:/tmp &lt;span class=&quot;nv&quot;&gt;$&amp;gt;&lt;/span&gt; docker logs restarter &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt;
2024-03-07 08:03 - app yeniden başlatıldı.
app
2024-03-07 08:04 - app yeniden başlatıldı.
app
2024-03-07 08:04 - app yeniden başlatıldı.
app
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;docker-compose.yaml (&lt;a href=&quot;https://gist.github.com/kizzx2/782b500a81ce46b889903b1f80353f21&quot;&gt;https://gist.github.com/kizzx2/782b500a81ce46b889903b1f80353f21&lt;/a&gt;) &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>VBoxManage ile VirtualBox üzerindeki sanal makinelerin bütün network kartlarını silme</title>
   <summary>VBoxManage ile VirtualBox üzerindeki sanal makinelerin bütün network kartlarını silme</summary>
   <link href="https://www.sercangezer.com.tr/2024/vboxmanage-ile-sanal-makinelerin-network-kartlarini-kaldirma"/>
   <updated>2024-03-05T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2024/VBoxManage-ile-sanal-makinelerin-network-kartlarini-kaldirma</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Vagrantfile ile oluşturduğum makinelere Bridge network vermekle uğraşmak istemezken &lt;strong&gt;VirtualBox üzerindeki sanal makinelerin network kartlarını script ile nasıl kaldırırım?&lt;/strong&gt; a geldim ve aşağıdaki script bu ameleliği üzerimizden alıyor.&lt;/p&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;# Sanal makine adları&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;vm_names&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;master&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;worker01&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;worker02&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Her bir sanal makine için tüm network interfacelerini silme işlemi&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;vm_name &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;vm_names&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[@]&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# Host-only interfaceleri kaldırma&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;hostonly_interfaces&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;VBoxManage showvminfo &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$vm_name&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--machinereadable&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-oP&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;hostonlyadapter\d+=&apos;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-oP&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;\d+&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;hostonly_interface &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$hostonly_interfaces&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;do
        &lt;/span&gt;VBoxManage modifyvm &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$vm_name&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--nic&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$hostonly_interface&lt;/span&gt; none
    &lt;span class=&quot;k&quot;&gt;done
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Sanal makine &apos;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$vm_name&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos; için hostonly network interfaceleri başarıyla silindi.&quot;&lt;/span&gt;



    &lt;span class=&quot;c&quot;&gt;# bridge interfaceleri kaldırma&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;bridge_interfaces&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;VBoxManage showvminfo &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$vm_name&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--machinereadable&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-oP&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;bridgeadapter\d+=&apos;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-oP&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;\d+&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;bridge_interface &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$bridge_interfaces&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;do
        &lt;/span&gt;VBoxManage modifyvm &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$vm_name&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--nic&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$bridge_interface&lt;/span&gt; none
    &lt;span class=&quot;k&quot;&gt;done
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Sanal makine &apos;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$vm_name&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos; için bridge network interfaceleri başarıyla silindi.&quot;&lt;/span&gt;

     &lt;span class=&quot;c&quot;&gt;# NAT interfaceleri kaldırma&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;nat_interfaces&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;VBoxManage showvminfo &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$vm_name&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--machinereadable&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-oP&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;natnet\d+=&apos;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-oP&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;\d+&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;nat_interface &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$nat_interfaces&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;do
        &lt;/span&gt;VBoxManage modifyvm &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$vm_name&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--nic&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$nat_interface&lt;/span&gt; none
    &lt;span class=&quot;k&quot;&gt;done
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Sanal makine &apos;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$vm_name&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos; için NAT network interfaceleri başarıyla silindi.&quot;&lt;/span&gt; 
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>`kafka` PORT is deprecated. Please use SCHEMA_REGISTRY_LISTENERS instead. hatası ve çözümü</title>
   <summary>HELM chartlarda `kafka` PORT is deprecated. Please use SCHEMA_REGISTRY_LISTENERS instead. hatası ve çözümü</summary>
   <link href="https://www.sercangezer.com.tr/2024/kafka-helm-chart-port-is-deprecated-sorunu-ve-cozumu"/>
   <updated>2024-02-27T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2024/kafka-helm-chart-port-is-deprecated-sorunu-ve-cozumu</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Bir projeyi HELM chart lara çevirirken &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cp-kafka&lt;/code&gt; (6.2.0) servisinde çok ilginç bir hata ile karşılaştım.&lt;/p&gt;

&lt;p&gt;HELM chart oluşturup deploy ettiğimde, kafka loglarında;&lt;/p&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;PORT is deprecated. Please use SCHEMA_REGISTRY_LISTENERS instead.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;hata atıyor. Oysa ki environment olarak configmap içerisinde tanımlı.&lt;/p&gt;

&lt;h2 id=&quot;çözümü&quot;&gt;Çözümü&lt;/h2&gt;

&lt;p&gt;Sadece deployment adını &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;KAFKA&lt;/code&gt; koymamanız gerekiyor. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kafka1&lt;/code&gt; koyunca sorunsuz olarak çalışıyor..&lt;/p&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>`sha256sum` ile dosyaların veri bütünlüğünü kontrol etme</title>
   <summary>Linux ortamlarda `sha256sum` ile dosya ve klasörlerin veri bütünlüğünü kontrol edin.</summary>
   <link href="https://www.sercangezer.com.tr/2024/sha256sum-dosyalarin-veri-butunlugunu-kontrol-edin"/>
   <updated>2024-02-10T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2024/sha256sum-dosyalarin-veri-butunlugunu-kontrol-edin</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Lokalimizde çalışan HELM Chart ları bir müşterimize USB ile verdiğimizde kendi ortamlarında deploy edildiğinde uygulamanın çalışmadığı iletildi. Kendimiz tekrar USB ile götürüp deploy ettiğimizde uygulama ayağa kalktı..&lt;/p&gt;

&lt;p&gt;Bir daha böyle bir sorunla karşılaşmamak adına bir yöntem bulmamız gerekiyordu. O da &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sha256sum&lt;/code&gt; ..&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Çalışma ortamınız linux ise &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sha256sum&lt;/code&gt; kurulu olarak geliyor.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Kontrol edeceğimiz klasörün içine giriş aşağıdaki komutu çalıştırıyoruz.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&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;find &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-type&lt;/span&gt; f &lt;span class=&quot;nt&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sha256sum&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; + &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;+%Y%m%d_%H%M&quot;&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;_checksums.sha256
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Oluşturduğumuz dosyaya baktığımızda &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sha256&lt;/code&gt; - &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Dosya adı&lt;/code&gt; şeklinde verilerin olduğunu görüyoruz.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;.&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
  b18bcb13bd1e1f51d7081e2bb1841d046835a37c8bea72a942c737f1870ec011  ./config/menus/version.ipxe
  09d592c451a350dc946f20b8a0c4d0d5667a90e986de39df3b572076bd11396c  ./config/menus/vmware.ipxe
  93f4530175d1cea921fd35c7fd4603c76c3c383aa4ed35d8f0df66a8eafd3b4a  ./config/menus/vyos.ipxe
  6d88517ed96750b94daaa0abd86220e0fa2585fb6b7731f30b8f1e8c9e481bd4  ./config/menus/zeninstall.ipxe
  a5893dc6065a1e18bdfc41cc5bd1820ec4f8262206ecb68b9221204da8d16faa  ./config/endpoints.yml
  fd09ddf4b8ed7383c711bbab444292447d46b63d53bcd8ca2359a76cfbfea2e2  ./config/menuversion.txt
  05d989781bee5ddae40d901612a22893d670dcb53805798412e64183689817e7  ./checksums.sha256
  31c33d36a65bf822d7d8679a9785e252aac4b339a494cc5f6c56d9346028e1f3  ./docker-compose.yaml
  3f9eadd4320dfe2155c14c2b4cad5c21f138e2db82fa14b24015944bc20ab46f  ./20240210_1849_checksums.sha256
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;❗❗ &lt;strong&gt;docker-compose.yaml&lt;/strong&gt; dosyasında değişiklik yapıyorum ve kontrol ediyorum.&lt;/p&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;nb&quot;&gt;sha256sum&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; 20240210_1849_checksums.sha256
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Çıktı da görebileceğiniz gibi bir çıktı ile değişmiş olan dosyaları görebiliyoruz.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
./config/menus/vmware.ipxe: OK
./config/menus/vyos.ipxe: OK
./config/menus/zeninstall.ipxe: OK
./config/endpoints.yml: OK
./config/menuversion.txt: OK
./docker-compose.yaml: FAILED ❗
./20240210_1849_checksums.sha256: FAILED ❗
&lt;span class=&quot;nb&quot;&gt;sha256sum&lt;/span&gt;: WARNING: 2 computed checksums did NOT match ❗
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Artık elinizde hatanın sizden kaynaklanmadığına dair bir kanıtınız var.&lt;/p&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Linux terminalden klavye dili değiştirme</title>
   <summary>Linux ortamlarda setxkbmap ve localectl ile klavye dil değiştirme</summary>
   <link href="https://www.sercangezer.com.tr/2024/linux-terminalde-klavye-degistirme"/>
   <updated>2024-01-31T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2024/linux-terminalde-klavye-degistirme</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Bir sunucuya SSH attınız ve ya vCenter üzerinden konsol ile sunucuya eriştiğiniz. Hoop klavye dili &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;İngilizce&lt;/code&gt; ..&lt;/p&gt;

&lt;p&gt;Neyse ki çözümü basit.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Eğer bir kullanıcı arayüzü(X11,GNOME,KDE vs ) varsa;&lt;/li&gt;
&lt;/ul&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;setxkbmap &lt;span class=&quot;nb&quot;&gt;tr&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Minimal tarzda kurulmuşsa;&lt;/li&gt;
&lt;/ul&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;localectl set-keymap &lt;span class=&quot;nb&quot;&gt;tr&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Windterm Linux terminal kurulum</title>
   <summary>Open-source Linux terminal Windterm kurulum</summary>
   <link href="https://www.sercangezer.com.tr/2024/windterm-linux-terminal-kurulum"/>
   <updated>2024-01-06T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2024/windterm-linux-terminal-kurulum</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;../images/2024/20240106-windterm-linux-terminal-kurulum.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Windows ortamında terminal olarak &lt;a href=&quot;https://mobaxterm.mobatek.net/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MobaXterm&lt;/code&gt;&lt;/a&gt; ve &lt;a href=&quot;https://www.vandyke.com/products/securecrt/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SecureCRT&lt;/code&gt;&lt;/a&gt; kullananlar, Linux desktop ortamına geçtiğinde bu yazılımların sağlamış olduğu fonksiyoniteyi sağlayan bir uygulamayı bulamıyor.&lt;/p&gt;

&lt;p&gt;Tam bu ihtayaç ortamında 2 ürünün güzel yanlarının bir uygulamada toplanmış hali open-source &lt;a href=&quot;https://github.com/kingToolbox/WindTerm&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Windterm&lt;/code&gt;&lt;/a&gt; !!&lt;/p&gt;

&lt;p&gt;Kullanınca müptelası olacaksınız ..&lt;/p&gt;

&lt;p&gt;O zaman kuruluma geçelim.&lt;/p&gt;

&lt;h1 id=&quot;windterm-kurulum&quot;&gt;Windterm Kurulum&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Github sayfasından son sürüm kaynak dosyasını indirelim.&lt;/li&gt;
&lt;/ul&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;nv&quot;&gt;VER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt; curl &lt;span class=&quot;nt&quot;&gt;--silent&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/kingToolbox/WindTerm/releases/latest&quot;&lt;/span&gt;| &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&quot;tag_name&quot;&apos;&lt;/span&gt;|sed &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;s/.*&quot;([^&quot;]+)&quot;.*/\1/&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
wget https://github.com/kingToolbox/WindTerm/releases/download/&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;VER&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/WindTerm_&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;VER&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;_Linux_Portable_x86_64.tar.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;İndirdiğimiz(WindTerm_2.5.0_Linux_Portable_x86_64.tar.gz) tar dosyasını açalım.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-xvf&lt;/span&gt; WindTerm_2.5.0_Linux_Portable_x86_64.tar.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Klasörü &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/opt&lt;/code&gt; altına taşıyalım.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo mv &lt;/span&gt;WindTerm_2.5.0 /opt/WindTerm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Klasörün yetkilerini düzenleyelim.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo chmod&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; 775 /opt/WindTerm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Windterm kısayolu oluşturalım.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; | sudo tee /usr/share/applications/windterm.desktop
[Desktop Entry]
Name=WindTerm
Comment=A professional cross-platform SSH/Sftp/Shell/Telnet/Serial terminal
GenericName=Connect Client
Exec=/opt/WindTerm/WindTerm
Type=Application
Icon=/opt/WindTerm/windterm.png
StartupNotify=false
StartupWMClass=Code
Categories=Application;Development
Actions=new-empty-window
Keywords=windterm

[Desktop Action new-empty-window]
Name=New Empty Window
Icon=/opt/WindTerm/windterm.png
Exec=/opt/WindTerm/WindTerm
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Artık kullanmaya başlayabilirsiniz..&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Belirtilen klasörü Github repoya yeni bir branch olarak göndermek</title>
   <summary>Bir klasörü github repoya pushlamak</summary>
   <link href="https://www.sercangezer.com.tr/2023/klasoru-github-repoya-pushlamak"/>
   <updated>2023-12-24T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/klasoru-github-repoya-pushlamak</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Farklı projelerde ve farklı makinelerde kod ve konfigürasyon senkronizasyonu sağlamak adına github ve branch yapısını kullanıyorum. Elle teker teker github komutları girmektense bunu bash script e çevirdim. Belki benim gibi sizin de ihtiyacı olabilir.&lt;/p&gt;

&lt;h4 id=&quot;gereklilikler&quot;&gt;Gereklilikler&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Reponuz için okuma-yazma izni verilmiş SSH-KEY&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo&lt;/code&gt; yetkisi olan bir kullanıcı&lt;/li&gt;
  &lt;li&gt;Script içerisindeki değişkenlerin tanımlanması&lt;/li&gt;
&lt;/ul&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;#!/bin/bash&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# +-------------------------------------------------------------------+&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# | Author: Sercan GEZER                                              |&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# | Email: sercan.gezer.TR@gmail.com                                  |&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# +-------------------------------------------------------------------+&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;((&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$EUID&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; 0 &lt;span class=&quot;o&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; Lütfen SUDO komutu ile scripti tekrar çalıştırın !!&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;exit
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Push lanacak klasör&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;PUSHED_FOLDER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/home/sercangezer/ornek-klasor&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Push lanacak github reposu&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;GITHUB_REPO&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;git@github.com:sercangezer/sercangezer-workspace.git&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Push lanacak branch adı&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;BRANCH_NAME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;sercangezer-newbranch&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Push commit mesajı&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;COMMIT_MESSAGE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Bu klasör scriptle push lanmıştır.&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# SSH Anahtarını Tanımla&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;SSH_KEY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-----BEGIN OPENSSH PRIVATE KEY-----
.
.
.
.
-----END OPENSSH PRIVATE KEY-----
&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Klasörde 100 MB&apos;dan büyük dosyaları kontrol et&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;BIG_FILES&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;find &lt;span class=&quot;nv&quot;&gt;$PUSHED_FOLDER&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-type&lt;/span&gt; f &lt;span class=&quot;nt&quot;&gt;-size&lt;/span&gt; +100M&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$BIG_FILES&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
	&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Uyarı: FREE GITHUB 100MB&apos;dan büyük dosya kabul etmiyor.&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Uyarı: Aşağıdaki dosyalar 100 MB&apos;dan büyük:&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$BIG_FILES&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Git kullanıcı adı ve e-posta adresini kontrol et&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;GIT_USER_EMAIL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;git config &lt;span class=&quot;nt&quot;&gt;--global&lt;/span&gt; user.email&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;GIT_USER_NAME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;git config &lt;span class=&quot;nt&quot;&gt;--global&lt;/span&gt; user.name&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-z&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$GIT_USER_EMAIL&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-z&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$GIT_USER_NAME&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hata: Git kullanıcı adı ve/veya e-posta adresi ayarlanmamış.&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hata: git config --global user.email &apos;example@example.org&apos; ile atayabilirsin.&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hata: git config --global user.name &apos;ISIMSIZ&apos; ile atayabilirsin.&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Geçici bir dizinde SSH anahtarını sakla&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;SSH_DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mktemp&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SSH_KEY&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SSH_DIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/ssh_key&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;600 &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SSH_DIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/ssh_key&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# SSH Anahtarını kullanarak bağlanmak için Git ve SSH ayarlarını yap&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GIT_SSH_COMMAND&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ssh -i &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SSH_DIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/ssh_key -o IdentitiesOnly=yes&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Git reposuna git&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$PUSHED_FOLDER&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; .git

&lt;span class=&quot;c&quot;&gt;# Yerel git deposunu başlat&lt;/span&gt;
git init

&lt;span class=&quot;c&quot;&gt;# Uzak depoyu ekle&lt;/span&gt;
git remote add origin &lt;span class=&quot;nv&quot;&gt;$GITHUB_REPO&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Yeni bir branch oluştur ve değişiklikleri ekle&lt;/span&gt;
git checkout &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$BRANCH_NAME&lt;/span&gt;
git add &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Commit yap ve push et&lt;/span&gt;
git commit &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$COMMIT_MESSAGE&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
git push &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; origin &lt;span class=&quot;nv&quot;&gt;$BRANCH_NAME&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# SSH Anahtarını ve geçici dizini temizle&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; .git
&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SSH_DIR&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;çalıştırmak için;&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo &lt;/span&gt;bash script-name.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Vagrantfile&apos;da sunucunun disk boyutunu ayarlama</title>
   <summary>Vagrantfile sunucunun disk boyutunu ayarlama</summary>
   <link href="https://www.sercangezer.com.tr/2023/vagrantfile-da-sunucunun-disk-boyutunu-ayarlama"/>
   <updated>2023-12-19T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/vagrantfile-da-sunucunun-disk-boyutunu-ayarlama</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;../images/2023/20231219-vagrantfile-da-sunucunun-disk-boyutunu-ayarlama.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.vagrantup.com/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Vagrant&lt;/code&gt;&lt;/a&gt;, geliştirme ortamlarını hızlıca ayağa kaldırmak için kullandığımız güzel bir ürün. Vagrantfile ile bir sunucu ayağa kaldırdığımızda &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;40GB&lt;/code&gt; bir disk boyutu ile ayaklandırıyor.&lt;/p&gt;

&lt;p&gt;Bundan 7 yıl önce bu sorun için bir plugin yazılmış hayırsever bir arkadaş tarafından. Bknz: &lt;a href=&quot;https://github.com/sprotheroe/vagrant-disksize&quot;&gt;&lt;strong&gt;github/vagrant-disksize&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;kurulum&quot;&gt;Kurulum&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vagrant-disksize&lt;/code&gt; eklentisini sistemimize yükleyelim.&lt;/li&gt;
&lt;/ul&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;vagrant plugin &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;vagrant-disksize
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Vagrantfile&lt;/code&gt; dosyamızdaki &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;config&lt;/code&gt; kısmına aşağıdaki parametreyi ekliyoruz.&lt;/li&gt;
&lt;/ul&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;  config.vm.define &lt;span class=&quot;s2&quot;&gt;&quot;sercangezer&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; |sercangezer|
    sercangezer.vm.box &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ubuntu/jammy64&quot;&lt;/span&gt;
    sercangezer.disksize.size &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;100GB&apos;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;#Diskin 100GB olmasını istiyoruz.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Çıktısı&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;==&amp;gt;&lt;/span&gt; sercangezer: Resized disk: old 40960 MB, req 102400 MB, new 102400 MB
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; sercangezer: You may need to resize the filesystem from within the guest.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;dipnot&quot;&gt;Dipnot&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Eklenti yükleme işini de Vagrantfile’a bırakmak için Vagrantfile’ın üst kısmına aşağıdaki kod bloğunu ekleyebilirsiniz.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-ruby 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;n&quot;&gt;required_plugins&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;vagrant-disksize&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;plugins_to_install&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;required_plugins&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;select&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plugin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Vagrant&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;has_plugin?&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;plugin&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;plugins_to_install&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;empty?&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Yüklenen eklenti: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plugins_to_install&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos; &apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;vagrant plugin install &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plugins_to_install&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos; &apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;vagrant &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;ARGV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos; &apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;abort&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Eklenti yüklenemedi, manuel yüklemeyi deneyebilirsin.&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>spesifik Vagrantfile ile çalışmak</title>
   <summary>Geliştirme ortamlarında spesifik Vagrantfile ile çalışmak</summary>
   <link href="https://www.sercangezer.com.tr/2023/spesifik-vagrantfile-kullanmak"/>
   <updated>2023-12-18T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/spesifik-vagrantfile-kullanmak</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;../images/2023/20231218-spesifik-vagrantfile-kullanmak.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Geliştirme ortamlarını hızlıca ayağa kaldırmak için kullandığımız güzel bir uygulamadır &lt;a href=&quot;https://www.vagrantup.com/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Vagrant&lt;/code&gt;&lt;/a&gt;. Sunucuları ayağa kaldırabilmemiz için tabii ki de bir &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Vagrantfile&lt;/code&gt; konfigürasyon dosyamız mevcut.&lt;/p&gt;

&lt;p&gt;Genelde böyle uygulamalarda &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-f&lt;/code&gt; parametresi ile istediğimiz konfigürasyon dosyasından uygulamayı çalıştırabiliyoruz fakat &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Vagrant&lt;/code&gt; sadece &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Vagrantfile&lt;/code&gt; adındaki konfigürasyon dosyasını okuyor.&lt;/p&gt;

&lt;p&gt;Bunu aşmak için basit bir yöntem var. Kullanmak istediğimiz dosyayı değişkene atıyoruz. Şöyle ki;&lt;/p&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;nv&quot;&gt;VAGRANT_VAGRANTFILE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/home/sercangezer/benim-vagrantfile-m vagrant up
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>SKOPEO ile Konteynır İmaj ve Repo Yönetimi</title>
   <summary>SKOPEO ile Konteynır İmaj ve Repo Yönetimi</summary>
   <link href="https://www.sercangezer.com.tr/2023/skopeo-ile-konteynir-repo-ve-imajlari-yonetme"/>
   <updated>2023-11-27T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/skopeo-ile-konteynir-repo-ve-imajlari-yonetme</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;../images/2023/20231127-skopeo-ile-konteynir-repo-ve-imajlari-yonetme.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;h1 id=&quot;skopeo&quot;&gt;SKOPEO&lt;/h1&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/containers/skopeo&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Skopeo&lt;/code&gt;&lt;/a&gt;,  root hakkı gerektirmeden ve bir daemon’a ihtiyaç duymadan container image’larınızı bir repository’den başka bir repository’e taşımanızı sağlayan bir araç.&lt;/p&gt;

&lt;div class=&quot;admonition note rounded&quot;&gt;
    &lt;p class=&quot;admonition-title&quot;&gt;Örnek&lt;/p&gt;
    &lt;p&gt;
        &lt;b&gt;📌 NEXUS ADRESİMİZ: nexus.sercangezer.com.tr:30990&lt;/b&gt;
    &lt;/p&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;skopeo&lt;/code&gt; yüklenmesi &lt;a href=&quot;https://github.com/containers/skopeo/blob/main/install.md&quot;&gt;&lt;em&gt;(Diğer Dağıtımlar için kurulum rehberi)&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo &lt;/span&gt;apt-get update
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;skopeo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Private Nexus repomuza login olma söz dizimi&lt;/li&gt;
&lt;/ul&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;nv&quot;&gt;$ &lt;/span&gt;skopeo login &lt;span class=&quot;nt&quot;&gt;--tls-verify&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; admin &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; admin nexus.sercangezer.com.tr:30990
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Bir imajı indirmeden direkt olarak repodan repoya yükleme
    &lt;ul&gt;
      &lt;li&gt;quay.io –&amp;gt; nexus.sercangezer.com.tr&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&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;skopeo copy docker://quay.io/skopeo/stable:latest docker://nexus.sercangezer.com.tr:30990/sg-docker-internal/skopeo:latest &lt;span class=&quot;nt&quot;&gt;--dest-tls-verify&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--dest-creds&lt;/span&gt; admin:admin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Bir imajı direkt olarak tar olarak almak&lt;/li&gt;
&lt;/ul&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;skopeo copy docker://busybox:1.35.0 docker-archive:busybox-1_3_5.tar:busybox:1.35.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Bir imajın özelliklerini görebilmek için&lt;/li&gt;
&lt;/ul&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;skopeo inspect &lt;span class=&quot;nt&quot;&gt;--tls-verify&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;false  &lt;/span&gt;docker://nexus.sercangezer.com.tr:30990/sg-docker-internal/skopeo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Bir imajın direkt olarak version tag larını listeler&lt;/li&gt;
&lt;/ul&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;skopeo list-tags &lt;span class=&quot;nt&quot;&gt;--tls-verify&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;false &lt;/span&gt;docker://nexus.sercangezer.com.tr:30990/sg-docker-internal/skopeo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Bir imajın bütün versiyonlarını local (bilgisayar) klasöre çekme&lt;/li&gt;
&lt;/ul&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;skopeo &lt;span class=&quot;nb&quot;&gt;sync&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--src&lt;/span&gt; docker &lt;span class=&quot;nt&quot;&gt;--dest&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;dir &lt;/span&gt;nexus.sercangezer.com.tr:30990/sg-docker-internal/busybox /home/scope/repo-sync &lt;span class=&quot;nt&quot;&gt;--src-tls-verify&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Daha önce indirilmiş local (bilgisayar) klasörde bulunan imajları repoya aktarma&lt;/li&gt;
&lt;/ul&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;skopeo &lt;span class=&quot;nb&quot;&gt;sync&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--src&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;dir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--dest&lt;/span&gt; docker /home/scope/repo-sync nexus.sercangezer.com.tr:30990/sg-docker-internal/ &lt;span class=&quot;nt&quot;&gt;--dest-tls-verify&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--dest-creds&lt;/span&gt; admin:admin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Komple repo adı da dahil olarak imajları çeker&lt;/li&gt;
&lt;/ul&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;skopeo &lt;span class=&quot;nb&quot;&gt;sync&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--src&lt;/span&gt; docker &lt;span class=&quot;nt&quot;&gt;--dest&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;dir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--scoped&lt;/span&gt; nexus.sercangezer.com.tr:30990/sg-docker-internal/busybox /home/scope/repo-scopeed &lt;span class=&quot;nt&quot;&gt;--src-tls-verify&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&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;k8s-master::sysAdmin::~/repo-scopeed::
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;tree &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
└── nexus.sercangezer.com.tr:30990
    └── sg-docker-internal
        ├── busybox:1.34.0
        │   ├── 35dacafcdad5b63e0de9524c4be6bf7af78a493318b489840965b955ee4d7e60
        │   ├── 8336f9f1d0946781f428a155536995f0d8a31209d65997e2a379a23e7a441b78
        │   ├── manifest.json
        │   └── version
        ├── busybox:1.35.0
        │   ├── 48af2784ec85ce2b8194c39b667bad46c5aac55704236a98777fe9c5bb98d241
        │   ├── db2e1e3b46c0af1ae524f68073dccd02b5b10a0388a7b3a3f1617ee996376c34
        │   ├── manifest.json
        │   └── version
        ├── busybox:1.36.0
        │   ├── a58ecd4f0c864650a4286c3c2d49c7219a3f2fc8d7a0bf478aa9834acfe14ae7
        │   ├── af2c3e96bcf1a80da1d9b57ec0adc29f73f773a4a115344b7e06aec982157a33
        │   ├── manifest.json
        │   └── version
        └── busybox:latest
            ├── 3f4d90098f5b5a6f6a76e9d217da85aa39b2081e30fa1f7d287138d6e7bf0ad7
            ├── a416a98b71e224a31ee99cff8e16063554498227d2b696152a9c3e0aa65e5824
            ├── manifest.json
            └── version

6 directories, 16 files

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

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Linux VirtualBox üzerinde Host-Only network için IP aralığı sorunu</title>
   <summary>The IP address configured for the host-only network is not within the allowed ranges</summary>
   <link href="https://www.sercangezer.com.tr/2023/linux-virtualbox-host-only-network-ip-range-sorunu"/>
   <updated>2023-11-17T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/linux-virtualbox-host-only-network-ip-range-sorunu</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;../images/2023/20231117-linux-virtualbox-host-only-network-ip-range-sorunu.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Develop ortamlarımızın vazgeçilmez Type-II sanallaştırma uygulaması &lt;a href=&quot;https://www.virtualbox.org/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;VirtualBox&lt;/code&gt;&lt;/a&gt;‘ı Linux ortamlarda &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Host-Only Network&lt;/code&gt; ile birlikte kullandığımızda sadece makinelere &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.56.0/24&lt;/code&gt; aralığında IP vermemize izin veriyor.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Sanal makinemize &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.100.51&lt;/code&gt; gibi bir IP vermek istediğimizde aşağıdaki gibi bir hatayla karşılaşıyoruz.&lt;/li&gt;
&lt;/ul&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;The IP address configured &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;the host-only network is not within the
allowed ranges. Please update the address used to be within the allowed
ranges and run the &lt;span class=&quot;nb&quot;&gt;command &lt;/span&gt;again.

  Address: 192.168.100.51
  Ranges: 192.168.56.0/21

Valid ranges can be modified &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the /etc/vbox/networks.conf file. For
more information including valid format see:

  https://www.virtualbox.org/manual/ch06.html#network_hostonly

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

&lt;ul&gt;
  &lt;li&gt;Bunu aşabilmek ve istediğimiz IP’de sunucu oluşturabilmemiz için &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/vbox/networks.conf&lt;/code&gt; dosyasını aşağıdaki satırla değiştirmemiz gerekiyor.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; | sudo tee /etc/vbox/networks.conf
* 0.0.0.0/0 ::/0
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Artık istediğiniz IP’yi sanal makinelerinize verebilirsiniz.&lt;/p&gt;

&lt;p&gt;Esen kalın..&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Kubernetes ortamında Longhorn&apos;a Zone Anti-Affinity eklenmesi</title>
   <summary>How i can configure Zone Anti-Affinity in Longhorn Kubernetes</summary>
   <link href="https://www.sercangezer.com.tr/2023/kubernetes-longhorn-zone-anti-affinity-eklenmesi"/>
   <updated>2023-11-17T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/kubernetes-longhorn-zone-anti-affinity-eklenmesi</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;../images/2023/20231117-k8s-longhorn-zone-anti-affinity-eklenmesi.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;h1 id=&quot;longhorn-zone-anti-affinity-nedir&quot;&gt;Longhorn Zone Anti-Affinity nedir?&lt;/h1&gt;

&lt;p&gt;Longhorn kullanan projelerde Storage HA sağlamak için master ve worker node lara &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;label ekleyerek&lt;/code&gt; storage tarafında High Avaliability sağlıyoruz.&lt;/p&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;Örnek Senaryo: 3 master 6 worker olan bir cluster yapımızda 1 master 2 worker şeklinde zone oluşturup, Longhornda volume leri her zone da farklı makinelerde çalışmasını sağlayacağız.

&lt;span class=&quot;c&quot;&gt;# Zone1&lt;/span&gt;
master-01
worker-01
worker-02

&lt;span class=&quot;c&quot;&gt;# Zone2&lt;/span&gt;
master-02
worker-03
worker-04

&lt;span class=&quot;c&quot;&gt;# Zone3&lt;/span&gt;
master-03
worker-05
worker-06
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;konfigürasyon-yapılması&quot;&gt;Konfigürasyon yapılması&lt;/h1&gt;

&lt;div class=&quot;admonition tip rounded&quot;&gt;
    &lt;p class=&quot;admonition-title&quot;&gt;Tip&lt;/p&gt;
    &lt;p&gt;
        ❗❗ Longhorn, k3s üzerinde Helm v3 ile kurulmuştur.
    &lt;/p&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Node larımıza label ekliyoruz.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Örnek söz dizimi (Syntax);&lt;/p&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;kubectl label nodes &amp;lt;NODE_NAME&amp;gt; topology.kubernetes.io/zone&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;lt;ZONE_NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Bizim seneryomuza göre;&lt;/li&gt;
&lt;/ul&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;kubectl label nodes master-01 topology.kubernetes.io/zone&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;zone1
kubectl label nodes worker-01 topology.kubernetes.io/zone&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;zone1
kubectl label nodes worker-02 topology.kubernetes.io/zone&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;zone1
kubectl label nodes master-02 topology.kubernetes.io/zone&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;zone2
kubectl label nodes worker-03 topology.kubernetes.io/zone&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;zone2
kubectl label nodes worker-04 topology.kubernetes.io/zone&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;zone2
kubectl label nodes master-03 topology.kubernetes.io/zone&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;zone3
kubectl label nodes worker-05 topology.kubernetes.io/zone&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;zone3
kubectl label nodes worker-06 topology.kubernetes.io/zone&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;zone3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Longhorn dashboard a girip aşağıdaki ayarları set ediyoruz.&lt;/li&gt;
&lt;/ul&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;Replica Node Level Soft Anti-Affinity: TRUE &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;tikle&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Replica Zone Level Soft Anti-Affinity: TRUE &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;tikle&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Direkt olarak Kubernetes üzerinden &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;true&lt;/code&gt; set edebilirsiniz.&lt;/li&gt;
&lt;/ul&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;# Replica Node Level Soft Anti-Affinity: TRUE&lt;/span&gt;
kubectl &lt;span class=&quot;nt&quot;&gt;--namespace&lt;/span&gt; longhorn-system patch settings.longhorn.io replica-soft-anti-affinity &lt;span class=&quot;nt&quot;&gt;--type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;json&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;[{&quot;op&quot;:&quot;replace&quot;,&quot;path&quot;:&quot;/value&quot;,&quot;value&quot;:&quot;true&quot;}]&apos;&lt;/span&gt;


&lt;span class=&quot;c&quot;&gt;# Replica Zone Level Soft Anti-Affinity: TRUE&lt;/span&gt;
kubectl &lt;span class=&quot;nt&quot;&gt;--namespace&lt;/span&gt; longhorn-system patch settings.longhorn.io replica-zone-soft-anti-affinity &lt;span class=&quot;nt&quot;&gt;--type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;json&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;[{&quot;op&quot;:&quot;replace&quot;,&quot;path&quot;:&quot;/value&quot;,&quot;value&quot;:&quot;true&quot;}]&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Longhorn Dashboard &amp;gt; Volumes üzerinden artık hangi PVC’nin hangi zone da oluştuğunu görebilirsiniz.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;../images/2023/20231117-kubernetes-longhorn-zone-anti-affinity-eklenmesi.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Kubernetes ortamında HELM ile LONGHORN kurulumu</title>
   <summary>How i can install LONGHORN with HELM in Kubernetes cluster</summary>
   <link href="https://www.sercangezer.com.tr/2023/helm-ile-longhorn-kurulum"/>
   <updated>2023-11-17T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/helm-ile-longhorn-kurulum</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;../images/2023/20231117-kubernetes-ortaminda-helm-ile-longhorn-kurulum.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;h3 id=&quot;longhorn-nedir&quot;&gt;Longhorn nedir?&lt;/h3&gt;

&lt;p&gt;Longhorn, Rancher firması tarafından Kubernetes için geliştirilmiş dağınık (distributed) block storage sistemidir.&lt;/p&gt;

&lt;p&gt;Backup, Restore ve Storage HA sağlayabilmek için projelerimizde kullanıyoruz.&lt;/p&gt;

&lt;h3 id=&quot;longhorn-kurulum&quot;&gt;Longhorn Kurulum&lt;/h3&gt;

&lt;div class=&quot;admonition tip rounded&quot;&gt;
    &lt;p class=&quot;admonition-title&quot;&gt;Tip&lt;/p&gt;
    &lt;p&gt;
        ❗❗ k3s üzerinde Helm v3 ile kurulmuştur.
    &lt;/p&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Helm repo ekleyelim ve güncelleyelim.&lt;/li&gt;
&lt;/ul&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;helm repo add longhorn https://charts.longhorn.io
helm repo update
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Helm 3 ile Longhorn kuralım&lt;/li&gt;
&lt;/ul&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;kubectl create namespace longhorn-system
helm &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;longhorn longhorn/longhorn &lt;span class=&quot;nt&quot;&gt;--namespace&lt;/span&gt; longhorn-system
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;default storageclass olarak &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;longhorn&lt;/code&gt; storageclass ayarlayalım. Daha doğrusu 2  tane default storageclass oluyor &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;local-path&lt;/code&gt; storageclass varsayılanı kaldırıyoruz.&lt;/li&gt;
&lt;/ul&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;kubectl patch storageclass local-path &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{&quot;metadata&quot;: {&quot;annotations&quot;:{&quot;storageclass.kubernetes.io/is-default-class&quot;:&quot;false&quot;}}}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Çıktısı aşağıdaki gibidir&lt;/li&gt;
&lt;/ul&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;nv&quot;&gt;$ &lt;/span&gt;k get storageclasses.storage.k8s.io 

&lt;span class=&quot;c&quot;&gt;#Çıktısı&lt;/span&gt;
NAME                   PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
local-path &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;default&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;   rancher.io/local-path   Delete          WaitForFirstConsumer   &lt;span class=&quot;nb&quot;&gt;false                  &lt;/span&gt;105d
retained-storage       rancher.io/local-path   Retain          WaitForFirstConsumer   &lt;span class=&quot;nb&quot;&gt;false                  &lt;/span&gt;105d
longhorn &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;default&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;     driver.longhorn.io      Delete          Immediate              &lt;span class=&quot;nb&quot;&gt;true                   &lt;/span&gt;106s

&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;kubectl patch storageclass local-path &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{&quot;metadata&quot;: {&quot;annotations&quot;:{&quot;storageclass.kubernetes.io/is-default-class&quot;:&quot;false&quot;}}}&apos;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#Çıktısı&lt;/span&gt;
storageclass.storage.k8s.io/local-path patched


&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;k get storageclasses.storage.k8s.io 

&lt;span class=&quot;c&quot;&gt;#Çıktısı&lt;/span&gt;
NAME                 PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
retained-storage     rancher.io/local-path   Retain          WaitForFirstConsumer   &lt;span class=&quot;nb&quot;&gt;false                  &lt;/span&gt;105d
longhorn &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;default&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;   driver.longhorn.io      Delete          Immediate              &lt;span class=&quot;nb&quot;&gt;true                   &lt;/span&gt;2m11s
local-path           rancher.io/local-path   Delete          WaitForFirstConsumer   &lt;span class=&quot;nb&quot;&gt;false                  &lt;/span&gt;105d
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nodePort 31999&lt;/code&gt; ayarlayalım.&lt;/li&gt;
&lt;/ul&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;kubectl &lt;span class=&quot;nt&quot;&gt;--namespace&lt;/span&gt; longhorn-system patch svc longhorn-frontend &lt;span class=&quot;nt&quot;&gt;--type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;json&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;[{&quot;op&quot;:&quot;replace&quot;,&quot;path&quot;:&quot;/spec/type&quot;,&quot;value&quot;:&quot;NodePort&quot;},{&quot;op&quot;:&quot;replace&quot;,&quot;path&quot;:&quot;/spec/ports/0/nodePort&quot;,&quot;value&quot;:31999}]&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://SUNUCU_IP:31999&lt;/code&gt; ile Longhorn dashboard a ulaşabilirsiniz.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;../images/2023/20231117-helm-ile-longhorn-kurulum.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;longhorn-kaldırma&quot;&gt;Longhorn Kaldırma&lt;/h1&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;kubectl &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; longhorn-system patch &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{&quot;value&quot;: &quot;true&quot;}&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;merge lhs deleting-confirmation-flag
helm uninstall longhorn &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; longhorn-system
kubectl delete namespace longhorn-system
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Proxmox üzerindeki sanal makineyi VirtualBox a import etme</title>
   <summary>Proxmox vm export to VirtualBox</summary>
   <link href="https://www.sercangezer.com.tr/2023/proxmox-sanal-makineyi-virtualbox-import-etme"/>
   <updated>2023-10-30T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/proxmox-sanal-makineyi-virtualbox-import-etme</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;../images/2023/20231030-proxmox-sanal-makineyi-virtualbox-import-etme.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.proxmox.com&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Proxmox&lt;/code&gt;&lt;/a&gt; sanallaştırma ortamında bulunan sanal makinemizi kendi bilgisayarımıza alma ihtiyacı doğmuştu. Tekrar lazım olacağına düşünerek buraya not düşmek istediğim.&lt;/p&gt;

&lt;p&gt;O zaman başlayalım.&lt;/p&gt;

&lt;div class=&quot;admonition warning rounded&quot;&gt;
    &lt;p class=&quot;admonition-title&quot;&gt;Warning&lt;/p&gt;
    &lt;p&gt;
        &lt;br /&gt;❗ Proxmox&apos;un yüklü olduğu fiziksel makineye bağlanacağımız için çalıştıracağınız kodları dikkat ediniz.&lt;br /&gt;❗ Export işlemi CPU ve Memory tarafından yoğun bir işlemdir.O sebeple yoğun çalışan fiziksel makine üzerinde denemeyiniz.
    &lt;/p&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Export alacağımız hangi Proxmox fiziksel makinedeyse SSH ile bağlanıyoruz.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Sonraki işlemlerde kullanacağımız &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;VMID&lt;/code&gt; imizi bulalım.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&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;root@proxmox-c1:~# qm list

&lt;span class=&quot;c&quot;&gt;# output&lt;/span&gt;
VMID NAME                         STATUS     MEM&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;MB&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;    BOOTDISK&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;GPID       
100  sercangezer-k8s              running    32000      100.1363405   
102  sercangezer-compose          running    65536      150.55836     
103  sercangezer-Nexus            running    12288      400.692963   
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;103&lt;/code&gt; numaralı &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sercangezer-Nexus&lt;/code&gt; makinesinin export unu alacağım. Config ine kontrol edelim.&lt;/li&gt;
&lt;/ul&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;root@proxmox-c1:~# qm config 103

&lt;span class=&quot;c&quot;&gt;# output&lt;/span&gt;
boot: &lt;span class=&quot;nv&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;scsi0
cores: 2
ide2: none,media&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;cdrom
memory: 12288
meta: creation-qemu&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;7.1.0,ctime&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1698403327
name: sercangezer-nexus
net0: &lt;span class=&quot;nv&quot;&gt;virtio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;D6:65:2A:74:5A:1E,bridge&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;vmbr0
numa: 0
ostype: l26
scsi0: local-lvm:vm-103-disk-0,iothread&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1,size&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;400G
scsihw: virtio-scsi-single
smbios1: &lt;span class=&quot;nv&quot;&gt;uuid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;186b27f3-4318-481d-beca-438c6e048648
sockets: 2
vmgenid: faedaee9-1326-43be-9e05-cb08b1d9ddfe
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Proxmox üzerinde her bir makine bir &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;logical volume&lt;/code&gt;. Bu sebeple &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;103&lt;/code&gt; numaralı makinenin logical volume nu bulalım.&lt;/li&gt;
&lt;/ul&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;root@proxmox-c1:~# lvs | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; 103

&lt;span class=&quot;c&quot;&gt;#Output&lt;/span&gt;
LV            VG  Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert                                 
vm-103-disk-0 pve Vwi-aotz--  400.00g data        11.26 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vm-103-disk-0&lt;/code&gt; bilgisini kullanarak logical volume özelliklerine bakalım.&lt;/li&gt;
&lt;/ul&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;root@proxmox-c1:~# lvdisplay /dev/pve/vm-103-disk-0 
  
&lt;span class=&quot;c&quot;&gt;#OUTPUT  &lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;---&lt;/span&gt; Logical volume &lt;span class=&quot;nt&quot;&gt;---&lt;/span&gt;
LV Path                /dev/pve/vm-103-disk-0
LV Name                vm-103-disk-0
VG Name                pve
LV UUID                RHXaHM-c0Ra-zW6L-0u0m-Ao2p-PFh8-4EaeN9
LV Write Access        &lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt;/write
LV Creation host, &lt;span class=&quot;nb&quot;&gt;time &lt;/span&gt;nexus, 2023-10-27 13:42:43 +0300
LV Pool name           data
LV Status              available
&lt;span class=&quot;c&quot;&gt;# open                 1&lt;/span&gt;
LV Size                400.00 GiB
Mapped size            11.26%
Current LE             102400
Segments               1
Allocation             inherit
Read ahead sectors     auto
- currently &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;to     256
Block device           253:9
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;makinemiz çalışıyorsa durduralım&lt;/li&gt;
&lt;/ul&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;qm shutdown 103
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Export edelim&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;admonition info rounded&quot;&gt;
    &lt;p class=&quot;admonition-title&quot;&gt;Info&lt;/p&gt;
    &lt;p&gt;
        &lt;br /&gt;qemu-img convert -O vdi INPUT-PATH  OUTPUT.vdi 
    &lt;/p&gt;
&lt;/div&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;qemu-img convert &lt;span class=&quot;nt&quot;&gt;-O&lt;/span&gt; vdi /dev/pve/vm-103-disk-0 /root/sercangezer-nexus.vdi
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;/root altından dosyayı alıp VirtualBox üzerinde import edebilirsiniz.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Ansible ile kendi imzaladığımız SSL/TLS sertifika oluşturma</title>
   <summary>Ansible ile self-signed SSL/TLS sertifika oluşturma</summary>
   <link href="https://www.sercangezer.com.tr/2023/ansible-self-signed-ssl-tls-sertifika-olusturma"/>
   <updated>2023-10-24T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/ansible-self-signed-ssl-tls-sertifika-olusturma</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;../images/2023/20231024-ansible-self-signed-ssl-tls-certificate-create.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Develop ortamlarda SSL ihtiyacımız olduğu zaman &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;openssl&lt;/code&gt; ile makinelerimize kurup geçiyoruz. Fakat onlarca, yüzlerce makineniz varsa bu &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ansible-playbook&lt;/code&gt; tam size göre..&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Öncelikle  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ansible-playbook&lt;/code&gt; çalıştıracağımız makineye gerekli modülü yükleyelim.&lt;/li&gt;
&lt;/ul&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;ansible-galaxy collection &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;community.crypto
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Aşağıdaki taskları kendinize göre düzenleyip bütün makinelere basabilirsiniz.&lt;/li&gt;
&lt;/ul&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;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;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Self-signed&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;oluşturuyoruz&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;community.crypto.openssl_privatekey&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;path&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;/home/sercangezer/ssl/sercangezer.key&quot;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# private keyinizin tam yolu&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4096&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0600&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;RSA&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;present&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;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Self-signed&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sertifika&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;için&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Certificate&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;signing&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(CSR)&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;oluşturuyoruz.&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;community.crypto.openssl_csr_pipe&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;privatekey_path&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;/home/sercangezer/ssl/sercangezer.key&quot;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# private keyinizin tam yolu&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;common_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;develop.sercangezer.com.tr&quot;&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# domain adresi&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;organization_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;develop.sercangezer.com.tr&quot;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# domain adresi&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;subject_alt_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;DNS:develop.sercangezer.com.tr&apos;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# domain adresi&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;register&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;csr&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;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;yıl&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;geçerli&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;SSL/TLS&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;oluşturuyoruz.&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;community.crypto.x509_certificate&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;path&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;/home/sercangezer/ssl/sercangezer.crt&quot;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# public keyinizin tam yolu&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;privatekey_path&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;/home/sercangezer/ssl/sercangezer.key&quot;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# private keyinizin tam yolu&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;csr_content&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;&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;provider&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;selfsigned&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;selfsigned_not_after&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;+3650d&quot;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# 10 yıllık key oluşturuyoruz&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0644&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Github API ile organizasyondaki bütün repo lara etiket ekleme</title>
   <summary>Github API ile Github organizasyondaki bütün repositorylere label ekleme</summary>
   <link href="https://www.sercangezer.com.tr/2023/github-api-ile-organizasyondaki-repolara-etiket-ekleme"/>
   <updated>2023-10-20T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/github-api-ile-organizasyondaki-repolara-etiket-ekleme</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;../images/2023/20231020-github-api-ile-butun-repositorylerde-etiket-olustma.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Çalıştığımız bir proje ve buna bağlı repolarındaki bütün etiketleri silip, sadece bizim eklemek istediğimiz etiketleri ekleme gibi bir ihtayacımız oluşmuştu. &lt;a href=&quot;https://docs.github.com/en/rest&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Github API&lt;/code&gt;&lt;/a&gt; ile bu sorunumuzu python script ile çözdük.&lt;/p&gt;

&lt;p&gt;Belki bir gün başkalarına lazım olur diye buraya bırakıyorum.&lt;/p&gt;

&lt;div class=&quot;admonition tip rounded&quot;&gt;
    &lt;p class=&quot;admonition-title&quot;&gt;Tip&lt;/p&gt;
    &lt;p&gt;
        ❗ Github üzerinden &lt;b&gt;Personel Access Token&lt;/b&gt; oluşturmanız gerekmektedir.
    &lt;/p&gt;
&lt;/div&gt;

&lt;h3 id=&quot;çalışma-algoritması&quot;&gt;Çalışma Algoritması&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Repoların adlarını çeker&lt;/li&gt;
  &lt;li&gt;Repoların etiketlerini listeler
    &lt;ul&gt;
      &lt;li&gt;Repoların bütün etiketlerini siler&lt;/li&gt;
      &lt;li&gt;Repolarda yeni etiketleri oluşturur&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-python 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;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;requests&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Repolar neye aitse onun kullanıcı adını giriyoruz. &apos;Organizasyon adı&apos; ve ya &apos;kullanıcı adı&apos;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;owner&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;ORGANIZASYON_ADI_VEYA_USERNAME&apos;&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# Personal Access Token&apos;ımız
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;token&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;PERSONAL_ACCESS_TOKEN_GIRINIZ&apos;&lt;/span&gt;



&lt;span class=&quot;c1&quot;&gt;# Header ımızı oluşturuyoruz.
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&apos;Authorization&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;token &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;token&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&apos;Accept&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;application/vnd.github+json&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&apos;X-GitHub-Api-Version&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;2022-11-28&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Organizasyon ve ya kullanıcıya ait repoları listeliyoruz.
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;repos_url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;https://api.github.com/orgs/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;owner&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/repos&apos;&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# Organizasyon için
#repos_url = f&apos;https://api.github.com/users/{owner}/repos&apos;  # Kullanıcı için
&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;requests&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;repos_url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;


&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;status_code&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;repositories&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;repo&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;repositories&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;repo_name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;repo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;name&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

        &lt;span class=&quot;c1&quot;&gt;# Repository lerimizdeki etiketleri çekiyoruz.
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;requests&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;owner&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;repo_name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/labels&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;status_code&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;labels&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

            &lt;span class=&quot;c1&quot;&gt;# Repodaki bütün etiketleri siliyoruz
&lt;/span&gt;            &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;label&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;labels&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;label_name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;name&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;requests&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;owner&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;repo_name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/labels/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;label_name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

                &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;status_code&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;204&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
                    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Deleted label: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;label_name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
                    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Failed to delete label: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;label_name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Failed to list labels&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;


        &lt;span class=&quot;c1&quot;&gt;#  Oluşturulacak etiketlerin bilgilerini giriyoruz.
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;labels_to_create&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;in review&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;color&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;01DFDE&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Gözden Geçirilecek&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;postponed&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;color&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;D543F1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Ertelenen İşler&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;sprint&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;color&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;FBCA04&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Sprint içerisindeki konular&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

        &lt;span class=&quot;c1&quot;&gt;# API endpoint imiz
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;owner&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;repo_name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/labels&apos;&lt;/span&gt;

        &lt;span class=&quot;c1&quot;&gt;# Etiket oluşturuyoruz.
&lt;/span&gt;        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;label_data&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;labels_to_create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;label_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;requests&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;label_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

            &lt;span class=&quot;c1&quot;&gt;# Oluşturduysa ekrana bilgi basar
&lt;/span&gt;            &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;status_code&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;201&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Label &apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;label_name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos; created successfully.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Failed to create label. Status code: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;status_code&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Failed to retrieve repositories. Status code: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;status_code&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

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

&lt;ul&gt;
  &lt;li&gt;Şöyle bir çıktıyla karşılacaksınız.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
Deleted label: bug
Deleted label: documentation
Deleted label: duplicate
Deleted label: enhancement
Deleted label: good first issue
Deleted label: &lt;span class=&quot;nb&quot;&gt;help &lt;/span&gt;wanted
Deleted label: invalid
Deleted label: question
Deleted label: wontfix
Label &lt;span class=&quot;s1&quot;&gt;&apos;in review&apos;&lt;/span&gt; created successfully.
Label &lt;span class=&quot;s1&quot;&gt;&apos;postponed&apos;&lt;/span&gt; created successfully.
Label &lt;span class=&quot;s1&quot;&gt;&apos;sprint&apos;&lt;/span&gt; created successfully.
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Linux ortamlarda rbenv ile farklı ruby versiyonları kullanma</title>
   <summary>Linux ortamlarda rbenv ile farklı ruby versiyonları kullanma</summary>
   <link href="https://www.sercangezer.com.tr/2023/linux-rbenv-kurulum-ve-konfigurasyon"/>
   <updated>2023-10-17T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/Linux-rbenv-kurulum-ve-konfigurasyon</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;../images/2023/20231017-linux-rbenv-kurulum-ve-konfigurasyon.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Bu blogu &lt;a href=&quot;https://jekyllrb.com/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Jekyll&lt;/code&gt;&lt;/a&gt; ile &lt;a href=&quot;https://pages.github.com/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;github-pages&lt;/code&gt;&lt;/a&gt; üzerinden host ediyorum. Bir modül denemek için ruby nin farklı bir versiyonu yüklü olması gerekiyormuş. Komple ruby silip o versiyonu yüklemek yerine &lt;a href=&quot;https://github.com/rbenv/rbenv&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rbenv&lt;/code&gt;&lt;/a&gt; ile herhangi bir şey silmeden istediğimiz ruby versiyonu yükleyip, onu kullanabiliyoruz.&lt;/p&gt;

&lt;p&gt;Ben Linux dağıtımı olan RedHat tabanlı Fedora 38 üzerinde bu kurulumu gerçekleştireceğim.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rbenv&lt;/code&gt; yazılımı yükleyelim.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo &lt;/span&gt;dnf &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;rbenv &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rbenv&lt;/code&gt; konfigürasyonları direkt alabilmek için &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.bashrc&lt;/code&gt; dosyamıza PATH giriyoruz.&lt;/li&gt;
&lt;/ul&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;# .bashrc dosyamızı açıyoruz.&lt;/span&gt;
vi ~/.bashrc

&lt;span class=&quot;c&quot;&gt;# En altına aşağıdaki konfigürasyonu ekleyip, :wq ile kaydediyoruz.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/.rbenv/shims:&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;eval&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;rbenv init -&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Ayarların aktif ediyoruz.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Kurabileceğimiz sürümleri görüntüleyelim.&lt;/li&gt;
&lt;/ul&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;# Kurabileceğimiz stabil ruby sürümleri&lt;/span&gt;
rbenv &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Kurabileceğimiz ruby sürümleri&lt;/span&gt;
rbenv &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2.6.10&lt;/code&gt; sürümünü kurmak istiyorum.&lt;/li&gt;
&lt;/ul&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;# Ruby 2.6.10 versiyonunu kuralım&lt;/span&gt;
rbenv &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;2.6.10
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Sistemimizdeki versiyonları listelediğimizde artık &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2.6.10&lt;/code&gt; ruby versiyonunu da görebileceğiz.&lt;/li&gt;
&lt;/ul&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;rbenv &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;2.6.10

&lt;span class=&quot;c&quot;&gt;# Çıktısı&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; system &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;by /home/sercangezer/.rbenv/version&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  2.6.10
  2.7.5
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Artık sistemimizdeki ruby versiyonunu 2.6.10 olarak değiştirelim.&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;Önce versiyonumuzu bir kontrol edelim.&lt;/li&gt;
    &lt;/ul&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;ruby &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#Çıktısı&lt;/span&gt;
ruby 3.2.2 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2023-03-30 revision e51014f9c0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;x86_64-linux]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&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;# Ruby versiyonunu 2.6.10 a çekme&lt;/span&gt;
rbenv global 2.6.10
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Versiyonları kontrol edelim.&lt;/li&gt;
&lt;/ul&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;# Ruby versiyonu kontrol edelim.&lt;/span&gt;
ruby &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Çıktısı&lt;/span&gt;
ruby 2.6.10p210 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2022-04-12 revision 67958&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;x86_64-linux]

&lt;span class=&quot;c&quot;&gt;# gem versiyonunu kontrol edelim.&lt;/span&gt;
gem &lt;span class=&quot;nb&quot;&gt;env &lt;/span&gt;home

&lt;span class=&quot;c&quot;&gt;#Çıktısı&lt;/span&gt;
/home/sercangezer/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Tekrar sistemde varsayılan olan sürüme dönmek için;&lt;/li&gt;
&lt;/ul&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;rbenv global system
rbenv &lt;span class=&quot;nb&quot;&gt;local&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--unset&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Esen kalın …&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Lens ile kubernetes objelerini görselleştirme</title>
   <summary>Lens ile kubernetes objelerini görselleştirme</summary>
   <link href="https://www.sercangezer.com.tr/2023/lens-resource-map-eklentisi"/>
   <updated>2023-10-16T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/lens-resource-map-eklentisi</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Kubernetes cluster yönetimini &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kubectl&lt;/code&gt; gibi native araçlar ile yapabileceğimiz gibi &lt;a href=&quot;https://k8slens.dev/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Lens&lt;/code&gt;&lt;/a&gt; gibi GUI si olan araçlarda yönetimi kolaylaştırabiliyor.&lt;/p&gt;

&lt;p&gt;Lens uygulamasının kubernetes objelerinin ilişkilerini görselleştiren &lt;a href=&quot;https://github.com/nevalla/lens-resource-map-extension&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Lens Resource Map&lt;/code&gt;&lt;/a&gt; eklentisini kuracağız.&lt;/p&gt;

&lt;p&gt;Kuruluma geçelim …&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Lens uygulamasını açalım.&lt;/li&gt;
  &lt;li&gt;Sol üst menüden File &amp;gt; Extensions kısmına tıklayarak, açılan ekranda aşağıdaki URL’i girelim.&lt;/li&gt;
&lt;/ul&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;@nevalla/kube-resource-map
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;ve Install diyoruz.&lt;/li&gt;
  &lt;li&gt;Yükleme tamamlandıktan sonra Lens’i kapatıp açtığımızda sol menüde &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Resource Map&lt;/code&gt; kısmından görselleştirilmiş ilişkileri görebilirsiniz.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;../images/2023/2023-10-16-lens-resource-map-eklentisi.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Kubeview ile kubernetes objelerini görselleştirme</title>
   <summary>Kubeview ile kubernetes cluster objelerini görselleştirme</summary>
   <link href="https://www.sercangezer.com.tr/2023/kubeview-ile-kubernetes-objelerini-gorsellestirme"/>
   <updated>2023-10-16T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/kubeview-ile-kubernetes-objelerini-gorsellestirme</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Yeni bir kubernetes ortamında çalışmaya başladığınızda ilk etapta objelerin birbiriyle ilişkilerini kurmakta zorlanırız. Bunu bir nebze azaltabilmek için &lt;a href=&quot;https://github.com/benc-uk/kubeview&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kubeview&lt;/code&gt;&lt;/a&gt; kullanarak görselleştirme yapabiliriz..&lt;/p&gt;

&lt;p&gt;Kubeview in görselleştirebildiği objeler;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Deployments&lt;/li&gt;
  &lt;li&gt;ReplicaSets / StatefulSets / DaemonSets&lt;/li&gt;
  &lt;li&gt;Pods&lt;/li&gt;
  &lt;li&gt;Services&lt;/li&gt;
  &lt;li&gt;Ingresses&lt;/li&gt;
  &lt;li&gt;LoadBalancer IPs&lt;/li&gt;
  &lt;li&gt;PersistentVolumeClaims&lt;/li&gt;
  &lt;li&gt;Secrets&lt;/li&gt;
  &lt;li&gt;ConfigMaps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kuruluma geçelim…&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Repoyu indirelim.&lt;/li&gt;
&lt;/ul&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;git clone https://github.com/benc-uk/kubeview
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Chart dizinine gidelim.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;cd &lt;/span&gt;kubeview/charts/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kubeview/values.yaml&lt;/code&gt; dosyası içinden &lt;strong&gt;ingress&lt;/strong&gt; ve ya &lt;strong&gt;nodeport&lt;/strong&gt; tanımlayabilirsiniz.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;helm chart ı yükleyelim.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&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;helm &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;kubeview ./kubeview &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; myvalues.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Örnek bir ekran&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2023/2023-10-16-kubeview-ile-kubernetes-objelerini-gorsellestirme.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Nexus Repository programatik olarak dosya yükleme</title>
   <summary>Nexus Repository curl ile dosya yükleme</summary>
   <link href="https://www.sercangezer.com.tr/2023/nexus-repository-programatik-dosya-yukeleme"/>
   <updated>2023-10-15T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/nexus-repository-programatik-dosya-yukeleme</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Shell Script içerisinde programatik olarak curl ile Nexus repolarına dosya yükleyebiliyoruz.&lt;/p&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;# Değişkenleri tanımlıyoruz.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;_NEXUS_REGISTRY_USER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;admin
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;_NEXUS_REGISTRY_PASSWORD&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;admin
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;_NEXUS_GENERAL_REPOSITORY_URL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;https://nexus.sercangezer.com.tr

&lt;span class=&quot;c&quot;&gt;# Komutun söz dizimi&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-k&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; &amp;lt;NEXUS_KULLANICI_ADI&amp;gt;:&amp;lt;NEXUS_KULLANICI_PAROLASI&amp;gt; &lt;span class=&quot;nt&quot;&gt;--upload-file&lt;/span&gt; &amp;lt;YÜKLENECEK_DOSYANIN_FULL_PATHI&amp;gt; &amp;lt;NEXUS_REPOSITORY_URL&amp;gt;/&amp;lt;YUKLENECEK_DOSYA_ADI&amp;gt;

&lt;span class=&quot;c&quot;&gt;# curl ile gönderiyoruz.&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-k&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$_NEXUS_REGISTRY_USER&lt;/span&gt;:&lt;span class=&quot;nv&quot;&gt;$_NEXUS_REGISTRY_PASSWORD&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--upload-file&lt;/span&gt; /nfs-server/sg-setup.tar.gz &lt;span class=&quot;nv&quot;&gt;$_NEXUS_GENERAL_REPOSITORY_URL&lt;/span&gt;/repository/sg-raw-files/sg-setup/sg-setup.tar.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Nexus Repository curl ile healthcheck</title>
   <summary>Nexus Repository curl ile healthcheck</summary>
   <link href="https://www.sercangezer.com.tr/2023/nexus-repository-curl-ile-healthcheck-yapimi"/>
   <updated>2023-10-15T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/nexus-repository-curl-ile-healthcheck-yapimi</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Shell Script içerisinde programatik olarak curl ile Nexus repository’nin healthcheck yapılmasını sağlayan komut dizisi.&lt;/p&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;nv&quot;&gt;$&amp;gt;&lt;/span&gt; curl &lt;span class=&quot;nt&quot;&gt;-k&lt;/span&gt;  &lt;span class=&quot;s1&quot;&gt;&apos;https://nexus.sercangezer.com.tr/service/metrics/ping&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; admin:admin

&lt;span class=&quot;c&quot;&gt;#OUTPUT&lt;/span&gt;
pong
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Basit bir döngüye alarak, Nexus repository çevrimiçi/online olmasını bekleyebiliriz.&lt;/p&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;nv&quot;&gt;_NEXUS_ONLINE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;curl &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;GET&apos;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;http://nexus.sercangezer.com.tr/service/metrics/ping&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; admin:admin&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$_NEXUS_ONLINE&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;pong&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;do 
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;NEXUS  Repository daha online/çevrimiçi değil.&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;10
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;❗ SSL/TLS kullanıyorsanız &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl -k&lt;/code&gt; parametresini kullanmanız gerekiyor.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Linux ortamda Vagrant Virtualbox provider sorunu</title>
   <summary>Fedora Linux ortamda Vagrant Virtualbox provider sorunu</summary>
   <link href="https://www.sercangezer.com.tr/2023/linux-vagrant-virtualbox-provider-sorunu"/>
   <updated>2023-10-12T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/linux-vagrant-virtualbox-provider-sorunu</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Linux sunucularda vagrant ile test ortamı oluşturmaya çalıştığımızda &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;virtualbox provider&lt;/code&gt; ına değil de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libvirt provider&lt;/code&gt; a gitmeye çalışıyorsa aşağıdaki adımları uygulayarak çözüme gidebilirsiniz.&lt;/p&gt;

&lt;h3 id=&quot;hata&quot;&gt;HATA&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;Bringing machine &lt;span class=&quot;s1&quot;&gt;&apos;ansibledeney&apos;&lt;/span&gt; up with &lt;span class=&quot;s1&quot;&gt;&apos;libvirt&apos;&lt;/span&gt; provider...
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; ansibledeney: Box &lt;span class=&quot;s1&quot;&gt;&apos;ubuntu/jammy64&apos;&lt;/span&gt; could not be found. Attempting to find and install...
    ansibledeney: Box Provider: libvirt
    ansibledeney: Box Version: &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; 0
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; ansibledeney: Loading metadata &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;box &lt;span class=&quot;s1&quot;&gt;&apos;ubuntu/jammy64&apos;&lt;/span&gt;
    ansibledeney: URL: https://vagrantcloud.com/ubuntu/jammy64
The box you&lt;span class=&quot;s1&quot;&gt;&apos;re attempting to add doesn&apos;&lt;/span&gt;t support the provider
you requested. Please find an alternate box or use an alternate
provider. Double-check your requested provider to verify you didn&lt;span class=&quot;s1&quot;&gt;&apos;t
simply misspell it.

If you&apos;&lt;/span&gt;re adding a box from HashiCorp&lt;span class=&quot;s1&quot;&gt;&apos;s Vagrant Cloud, make sure the box is
released.

Name: ubuntu/jammy64
Address: https://vagrantcloud.com/ubuntu/jammy64
Requested provider: [:libvirt]

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

&lt;ul&gt;
  &lt;li&gt;Öncelikle vagrant ın güncel olup olmadığını kontrol edelim ve güncel repodan güncel sürümü çekelim. (Ben Fedora Linux kullanıyorum.)&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo &lt;/span&gt;dnf &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; dnf-plugins-core
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;dnf config-manager &lt;span class=&quot;nt&quot;&gt;--add-repo&lt;/span&gt; https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;dnf update
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;blockquote&gt;
  &lt;p&gt;❗ Diğer sürümlere ait repolar: https://developer.hashicorp.com/vagrant/downloads&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;VAGRANT_DEFAULT_PROVIDER&lt;/code&gt; global değişkenini &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.bashrc&lt;/code&gt; dosyamıza eklememiz gerekiyor.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;export VAGRANT_DEFAULT_PROVIDER=virtualbox&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.bashrc
&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Artık &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vagrant up&lt;/code&gt; ile sunucularımızı kaldırabiliriz.&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>AWX&apos;de Git (Source Control) Credential oluşturma</title>
   <summary>AWX&apos;de Git (Source Control) Credential oluşturma</summary>
   <link href="https://www.sercangezer.com.tr/2023/awx-git-source-control-credential-olusturma"/>
   <updated>2023-10-11T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/awx-git-source-control-credential-olusturma</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;AWX üzerinde Projects lerde kullanacağımız git repoları için &lt;strong&gt;source control&lt;/strong&gt; credential oluşturmamız gerekiyor.&lt;/p&gt;

&lt;p&gt;O zaman aksiyona geçelim …&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Öncelikle Github’a kaydedeceğimiz SSH Keyleri oluşturalım. Bunun için AWX çalışan makinemize bağlanıp, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ssh-keygen&lt;/code&gt; ile private ve public key oluşturuyoruz.&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.ssh/awx_ssh: &lt;/code&gt; Bizim private key dosyamız.&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.ssh/awx_ssh.pub: &lt;/code&gt; Bizim public key dosyamız.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&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;ssh-keygen &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; ed25519 &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;EMAIL_ADRESINIZ&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; ~/.ssh/awx_ssh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;❗❗ &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;enter passphrase&lt;/code&gt; kısmına gireceğiniz parolayı unutmayınız.!&lt;/p&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;ssh-keygen &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; ed25519 &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;EMAIL_ADRESINIZ&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; ~/.ssh/awx_ssh

Generating public/private ed25519 key pair.
Enter passphrase &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;empty &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;no passphrase&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;: &lt;span class=&quot;c&quot;&gt;#PAROLANIZ&lt;/span&gt;
Enter same passphrase again: &lt;span class=&quot;c&quot;&gt;#PAROLANIZ&lt;/span&gt;
Your identification has been saved &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; /home/sercangezer/.ssh/awx_ssh
Your public key has been saved &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; /home/sercangezer/.ssh/awx_ssh.pub
The key fingerprint is:
SHA256:4pCdp5z7bskijlJCYyFesMhJMjFnxkR7rQ6QOYM0804 EMAIL_ADRESINIZ
The key&lt;span class=&quot;s1&quot;&gt;&apos;s randomart image is:
+--[ED25519 256]--+
|=@B              |
|OXBo .           |
|@++E. .          |
| Oo. + .         |
|o o.+ + S        |
|. .o + =         |
| o  . =. .       |
|.  .. ..+        |
| ......=o        |
+----[SHA256]-----+

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

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;https://github.com/settings/keys adresinden &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;New SSH Key&lt;/code&gt; diyerek ekrana gelen &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TITLE&lt;/code&gt; ve &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;KEY&lt;/code&gt; kısmını doldurmamız gerekiyor.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TITLE: &lt;/code&gt; SSH-Key i betimleyecek kelimeler girebilirsiniz.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;KEY: &lt;/code&gt; Yukarıdaki adımda oluşturduğumuz public keyi yapıştırıyoruz.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;cat&lt;/span&gt; ~/.ssh/awx_ssh.pub

&lt;span class=&quot;c&quot;&gt;#ÇIKTIyı KEY kısmına yapıştırıyoruz ve KAYDEDIYORUZ.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;AWX Web UI &amp;gt; Resources &amp;gt; Credentials &amp;gt; Add diyerek yeni bir credential oluşturuyoruz.&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;Name&lt;/li&gt;
      &lt;li&gt;Description&lt;/li&gt;
      &lt;li&gt;Organization&lt;/li&gt;
      &lt;li&gt;Credentials Type: &lt;strong&gt;Source Control&lt;/strong&gt; olarak seçiyoruz.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Source Control&lt;/strong&gt; seçtikten sonra yeni alanlar geliyor.
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SCM Private Key: &lt;/code&gt; kısmına &lt;strong&gt;KEY imizi&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cat ~/.ssh/awx_ssh&lt;/code&gt;) çıktısını yapıştırıyoruz.&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Private Key Passphrase: &lt;/code&gt; ssh key oluştururken kullandığımız PAROLAyı giriyoruz.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Artık Project altında Git repolarında SSH-Key bağlantınızı kullabilirsiniz.&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Linux sunucularda diski klasöre kalıcı bağlama (Mount etme)</title>
   <summary>Linux sunucularda kalıcı olarak yeni diski klasöre bağlama (mount etme)</summary>
   <link href="https://www.sercangezer.com.tr/2023/linux-diski-klasore-kalici-baglama"/>
   <updated>2023-05-07T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/linux-diski-klasore-kalici-baglama</id>
   <content type="html">&lt;h2 id=&quot;video&quot;&gt;Video&lt;/h2&gt;

&lt;div align=&quot;center&quot;&gt;
&lt;iframe class=&quot;youtube-video&quot; src=&quot;https://www.youtube.com/embed/1JvNOPDkFFE&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Linux sunucularımıza yeni disk eklediğimizde bunu sunucularımıza tanıtıp, ulaşabileceğimiz bir klasöre kalıcı olarak bağlamamız gerekiyor.&lt;/p&gt;

&lt;h2 id=&quot;çalışma-ortamı&quot;&gt;Çalışma ortamı&lt;/h2&gt;

&lt;p&gt;🔥 VirtualBox üzerinde Vagrant ile otomatik kurulum için &lt;a href=&quot;https://gist.github.com/sercangezer/b7316008a0b9bc9974e311660a828dd2#file-vagrantfile&quot;&gt;&lt;strong&gt;Vagrantfile&lt;/strong&gt;&lt;/a&gt;&lt;/p&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;Sanallaştırma           :       VirtualBox
İşletim Sistemi         :       Centos7
IP                                  :       192.168.56.35
Hostname                 :       sercangezer-diskEkleme
Disk 1 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;5 GB]             :       /dev/sdb
Disk 2 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;8 GB]             :       /dev/sdc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;ön-hazırlık&quot;&gt;Ön Hazırlık&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;İşlemlerimizi &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;root&lt;/code&gt; kullanıcısı ile gerçekleştireceğiz.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;disklerimizi-bölümlendirelim&quot;&gt;Disklerimizi bölümlendirelim&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Bölümlendireceğimiz disklerin adlarını öğrenelim.&lt;/li&gt;
&lt;/ul&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;root@sercangezer-diskEkleme:/root &lt;span class=&quot;c&quot;&gt;#&amp;gt; lsblk -paf&lt;/span&gt;
NAME                                 FSTYPE         LABEL UUID                                                                 MOUNTPOINT
/dev/sda                                                      
└─/dev/sda1                     xfs                 1c419d6c-5064-4a2b-953c-05b2c67edb15              /
/dev/sdb                                                      
/dev/sdc  
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Bizim çalışmamızda &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/sdb&lt;/code&gt; ve &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/sdc&lt;/code&gt; diskleri.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Genelde disklerimizi    &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ext4&lt;/code&gt; ve ya  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xfs&lt;/code&gt; dosya türünde biçimlendirmeyi tercih ediyoruz. Tamamen ihtiyaçlar doğrultusunda bir seçim.  Bu çalışmamızda &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xfs&lt;/code&gt; olarak biçimlendireceğim.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Hızlıca diskimizi bölünmendirmek için aşağıdaki kodu çalıştıralım.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;devsdb-bölümlendirelim&quot;&gt;/dev/sdb bölümlendirelim&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;root@sercangezer-diskEkleme:/root &lt;span class=&quot;c&quot;&gt;#&amp;gt; fdisk /dev/sdb &amp;lt;&amp;lt;EOF&lt;/span&gt;
n
p
1


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

&lt;h3 id=&quot;devsdc-bölümlendirelim&quot;&gt;/dev/sdc bölümlendirelim&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;root@sercangezer-diskEkleme:/root &lt;span class=&quot;c&quot;&gt;#&amp;gt; fdisk /dev/sdc &amp;lt;&amp;lt;EOF&lt;/span&gt;
n
p
1


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

&lt;ul&gt;
  &lt;li&gt;Bölümlendirme yaptıktan sonraki son durum;&lt;/li&gt;
&lt;/ul&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;root@sercangezer-diskEkleme:/root &lt;span class=&quot;c&quot;&gt;#&amp;gt; lsblk -paf&lt;/span&gt;
NAME                                          FSTYPE                                    LABEL UUID                                                                   MOUNTPOINT
/dev/sda                                                      
└─/dev/sda1                             xfs                                             1c419d6c-5064-4a2b-953c-05b2c67edb15                  /
/dev/sdb                                                      
└─/dev/sdb1                                                   
/dev/sdc                                                      
└─/dev/sdc1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Gördüğünüz gibi artık elimizde &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/sdb1&lt;/code&gt; ve &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/sdc1&lt;/code&gt; adında disk bölümlerimiz oluştu.&lt;/p&gt;

&lt;h2 id=&quot;disk-bölümlerimizi-xfs-türünde-biçimlendirelim&quot;&gt;Disk bölümlerimizi ‘xfs’ türünde biçimlendirelim&lt;/h2&gt;

&lt;p&gt;Disklerimizi Linux sistemimize tanıttık fakat hangi verinin nerede tutulduğunu ve istediğimiz zaman erişebilmemiz için bu disklerimizi &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xfs&lt;/code&gt; dosya sistemi türünde biçimlendirmemiz gerekiyor.&lt;/p&gt;

&lt;h3 id=&quot;devsdb1-biçimlendirelim&quot;&gt;/dev/sdb1 biçimlendirelim&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;root@sercangezer-diskEkleme:/root &lt;span class=&quot;c&quot;&gt;#&amp;gt; mkfs.xfs /dev/sdb1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;devsdc1-biçimlendirelim&quot;&gt;/dev/sdc1 biçimlendirelim&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;root@sercangezer-diskEkleme:/root &lt;span class=&quot;c&quot;&gt;#&amp;gt; mkfs.xfs /dev/sdc1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xfs&lt;/code&gt; türünde biçimlendirdiğimizi teyit etmek için;&lt;/li&gt;
&lt;/ul&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;root@sercangezer-diskEkleme:/root &lt;span class=&quot;c&quot;&gt;#&amp;gt; lsblk -apf&lt;/span&gt;
NAME                              FSTYPE              LABEL UUID                                                                          MOUNTPOINT
/dev/sda                                                      
└─/dev/sda1                 xfs                       1c419d6c-5064-4a2b-953c-05b2c67edb15                        /
/dev/sdb                                                      
└─/dev/sdb1                 xfs                        cb6d96bb-fbda-473f-ad68-5d8f1eb298ba 
/dev/sdc                                                      
└─/dev/sdc1                 xfs                         cfc34bde-85e2-435c-a89c-8b525bf95574
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Görüldüğü gibi &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/sdb1&lt;/code&gt; ve &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/sdc1&lt;/code&gt; bölümlerinin FSTYPE ı &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xfs&lt;/code&gt; olarak görülüyor.&lt;/p&gt;

&lt;h2 id=&quot;klasörlere-bağlama&quot;&gt;Klasörlere bağlama&lt;/h2&gt;

&lt;p&gt;Disklerimize kolaylıkla ulaşabilmek için klasörlere bağlamalıyız.  Bizim örneğimizde &lt;strong&gt;/mnt&lt;/strong&gt; klasörü altındaki &lt;strong&gt;my-data&lt;/strong&gt; ve &lt;strong&gt;my-linux&lt;/strong&gt; klasörlerine bağlayacağız.&lt;/p&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;root@sercangezer-diskEkleme &lt;span class=&quot;c&quot;&gt;#&amp;gt; mkdir -p /mnt/my-data&lt;/span&gt;

root@sercangezer-diskEkleme &lt;span class=&quot;c&quot;&gt;#&amp;gt; mkdir -p /mnt/my-linux&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Oluşturdurduğumuz klasörlere &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mount&lt;/code&gt; komutuyla disklerimizi bağlıyoruz.&lt;/li&gt;
&lt;/ul&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;root@sercangezer-diskEkleme &lt;span class=&quot;c&quot;&gt;#&amp;gt; mount /dev/sdb1 /mnt/my-data/&lt;/span&gt;

root@sercangezer-diskEkleme &lt;span class=&quot;c&quot;&gt;#&amp;gt; mount /dev/sdc1 /mnt/my-linux/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Kontrol ettiğimizde bağlandığını görebiliyoruz.&lt;/li&gt;
&lt;/ul&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;root@sercangezer-diskEkleme:/mnt &lt;span class=&quot;c&quot;&gt;#&amp;gt; df -hT&lt;/span&gt;

Filesystem     Type      Size  Used Avail Use% Mounted on
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
/dev/sdb1      xfs       5.0G   33M  5.0G   1% /mnt/my-data
/dev/sdc1      xfs       8.0G   33M  8.0G   1% /mnt/my-linux
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;❗Fakat bu kalıcı bir bağlama olmadı. Sunucuyu yeniden başlattığımızda bu bağlantının koptuğunu göreceksiniz.&lt;/p&gt;

&lt;h2 id=&quot;kalici-olarak-klasöre-bağlama&quot;&gt;KALICI olarak klasöre bağlama&lt;/h2&gt;

&lt;p&gt;Klasöre kalıcı olarak bağladığımızda  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mount -av&lt;/code&gt; çıktısında gelmesi gerekiyor.&lt;/p&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;root@sercangezer-diskEkleme:/mnt &lt;span class=&quot;c&quot;&gt;#&amp;gt; mount -av&lt;/span&gt;
/                        : ignored
none                     : ignored
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Kalıcı hale getirmek için &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/fstab&lt;/code&gt; dosyanın içerisine bağlama bilgilerini yazmamız gerekiyor.&lt;/p&gt;

&lt;p&gt;İsterseniz &lt;strong&gt;vi/nano&lt;/strong&gt; text editör ile &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/fstab&lt;/code&gt; dosyasını açıp aşağıdaki tanımlamaları ekleyebilirsiniz.&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/dev/sdb1         /mnt/my-data          xfs           defaults          0 0
/dev/sdc1         /mnt/my-linux          xfs           defaults          0 0

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Direkt olarak &lt;strong&gt;/etc/fstab&lt;/strong&gt; dosyasının sonuna eklemek için;&lt;/p&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;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;/dev/sdb1         /mnt/my-data          xfs           defaults          0 0&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/fstab
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;/dev/sdc1         /mnt/my-linux          xfs           defaults          0 0&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/fstab
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Artık &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mount -av&lt;/code&gt; ile kontrol ettiğimizde kalıcı olarak bağlandığını görebileceğiz.&lt;/p&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;root@sercangezer-diskEkleme:/mnt &lt;span class=&quot;c&quot;&gt;#&amp;gt; mount -av&lt;/span&gt;

/                        : ignored
none                     : ignored
/mnt/my-data             : already mounted
/mnt/my-linux            : already mounted
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Linux RAID-1 disk yapılandırılması</title>
   <summary>RedHat tabanlı Linux dağıtımlarında RAID-1 disk yapılandırılması</summary>
   <link href="https://www.sercangezer.com.tr/2023/linux-raid-1-disk-yapilandirmasi"/>
   <updated>2023-04-14T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/linux-RAID-1-disk-yapilandirmasi</id>
   <content type="html">&lt;h2 id=&quot;video&quot;&gt;Video&lt;/h2&gt;

&lt;div align=&quot;center&quot;&gt;
&lt;iframe class=&quot;youtube-video&quot; src=&quot;https://www.youtube.com/embed/cwqdlaQSEWw&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;

&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Bugün VirtualBox üzerinde oluşturduğumuz Rocky Linux üzerindeki disklerimizi &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RAID-1 (Mirroring)&lt;/code&gt; türünde biçimlendireceğiz.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;RAID ile ilgili Türkçe olarak  &lt;a href=&quot;https://kerteriz.net/raid-nedir-raid-tipleri-ve-seviyeleri-nelerdir/&quot;&gt;&lt;strong&gt;RAID Nedir? RAID 0 - 1 - 5 - 6 - 10 Tipleri ve Farkları Nelerdir?&lt;/strong&gt;&lt;/a&gt; yazısını okumanızı tavsiye ederim.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;çalışma-ortamı&quot;&gt;Çalışma Ortamı&lt;/h2&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;Sanallaştırma     :       VirtualBox
İşletim Sistemi   :       Rocky Linux 9.1
IP                            :       192.168.1.57
Hostname           :       raid-1.sercangezer.com
Disk 1 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;5 GB]    :      /dev/sdb
Disk 2 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;5 GB]    :      /dev/sdc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;ön-hazırlık&quot;&gt;Ön Hazırlık&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;İşlemlerimizi &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;root&lt;/code&gt; kullanıcısı ile yapıyoruz.&lt;/li&gt;
  &lt;li&gt;RAID yapımızı yönetmek için &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mdadm&lt;/code&gt; yazılımını kullanıyoruz.  Kurulum için;&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# yum &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;mdadm &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Disklerimizde herhangi bir RAID tanımlanması yapılmış mı diye kontrol edelim.&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# mdadm &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; /dev/sd[b-c]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&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;# Çıktı&lt;/span&gt;
mdadm: No md superblock detected on /dev/sdb.
mdadm: No md superblock detected on /dev/sdc.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;disklerimizi-raid-için-bölümlendirme&quot;&gt;Disklerimizi RAID için bölümlendirme&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Hızlıca diskimizi bölümlendirmek için;&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/sdb&lt;/code&gt;)&lt;/p&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# fdisk /dev/sdb &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;
n
p
1


t
fd
w
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Hızlıca diskimizi bölümlendirmek için;&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/sdc&lt;/code&gt;)&lt;/p&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# fdisk /dev/sdc &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;
n
p
1


t
fd
w
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Disklerimizin bölümlendiğini kontrol etmek için;&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# mdadm &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; /dev/sd[b-c]


/dev/sdb:
   MBR Magic : aa55
Partition[0] :     41940992 sectors at         2048 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;type &lt;/span&gt;fd&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
/dev/sdc:
   MBR Magic : aa55
Partition[0] :     41940992 sectors at         2048 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;type &lt;/span&gt;fd&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;raid-1-cihazı-oluşturma&quot;&gt;RAID 1 cihazı oluşturma&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/sdb1&lt;/code&gt; ve &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/sdc1&lt;/code&gt; disk bölümlerini kullanarak &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/md0&lt;/code&gt; RAID cihazımızı oluşturalım.&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# mdadm &lt;span class=&quot;nt&quot;&gt;--create&lt;/span&gt; /dev/md0 &lt;span class=&quot;nt&quot;&gt;--level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;mirror &lt;span class=&quot;nt&quot;&gt;--raid-devices&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;2 /dev/sd[b-c]1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Çıktısı&lt;/strong&gt;&lt;/p&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;mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store &lt;span class=&quot;s1&quot;&gt;&apos;/boot&apos;&lt;/span&gt; on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    &lt;span class=&quot;nt&quot;&gt;--metadata&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;RAID oluşturma sürecini takip etmek için;&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# &lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/mdstat
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Çıktısı&lt;/strong&gt;&lt;/p&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]#  &lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/mdstat
Personalities : &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;raid1]
md0 : active raid1 sdc1[1] sdb1[0]
      20953088 blocks super 1.2 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;2/2] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;UU]
      &lt;span class=&quot;o&quot;&gt;[=============&amp;gt;&lt;/span&gt;.......]  resync &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 66.6% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;13963776/20953088&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;finish&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0.5min &lt;span class=&quot;nv&quot;&gt;speed&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;206105K/sec

unused devices: &amp;lt;none&amp;gt;


&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]#  &lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/mdstat
Personalities : &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;raid1]
md0 : active raid1 sdc1[1] sdb1[0]
      20953088 blocks super 1.2 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;2/2] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;UU]

unused devices: &amp;lt;none&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;RAID’e eklenen disk bölümleri hakkında bilgi almak için;&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# mdadm &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; /dev/sd[b-c]1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Oluşturduğumuz RAID cihazına ait bilgileri görmek için;&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# mdadm &lt;span class=&quot;nt&quot;&gt;--detail&lt;/span&gt; /dev/md0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;raid-cihazında-dosya-sistemi-oluşturma&quot;&gt;RAID cihazında dosya sistemi oluşturma&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/md0&lt;/code&gt; RAID cihazını &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ext4&lt;/code&gt; formatında biçimlendiriyoruz.&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# mkfs.ext4 /dev/md0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Çıktısı&lt;/strong&gt;&lt;/p&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;mke2fs 1.46.5 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;30-Dec-2021&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
/dev/md0 contains a ext4 file system
        created on Thu Apr 13 18:05:13 2023
Proceed anyway? &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;y,N&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; y
Creating filesystem with 5238272 4k blocks and 1310720 inodes
Filesystem UUID: b00be000-658c-4374-9918-94d3f15d383c
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000

Allocating group tables: &lt;span class=&quot;k&quot;&gt;done
&lt;/span&gt;Writing inode tables: &lt;span class=&quot;k&quot;&gt;done
&lt;/span&gt;Creating journal &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;32768 blocks&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;: &lt;span class=&quot;k&quot;&gt;done
&lt;/span&gt;Writing superblocks and filesystem accounting information: &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;

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

&lt;ul&gt;
  &lt;li&gt;Biçimlendirdiğimiz &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/md0&lt;/code&gt; RAID cihazını &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/raid-ornek&lt;/code&gt; klasörüne bağlayalım.&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# &lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; /raid-ornek
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# mount /dev/md0 /raid-ornek/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;df -hT &lt;/code&gt; ile baktığımızda cihazımızı başarıyla bağlandığını görüyoruz.&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# &lt;span class=&quot;nb&quot;&gt;df&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-hT&lt;/span&gt;
Filesystem                           Type      Size  Used Avail Use% Mounted on
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
/dev/md0                             ext4       20G   24K   19G   1% /raid-ornek
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;20G boyutunda 2 tane disk bağlamamıza rağmen RAID-1 (Mirroring) yaptığımız için tek disk gibi 20G görünüyor.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Sistem yeniden başladığında otomatik olarak bağlanabilmesi için &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/fstab&lt;/code&gt; dosyasına eklememiz gerekiyor.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; &amp;gt;&amp;gt; /etc/fstab
/dev/md0                /raid-ornek             ext4    defaults        0 0
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Otomatik bağlandığını (mount) kontrol edelim.&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# mount &lt;span class=&quot;nt&quot;&gt;-av&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
/raid-ornek              : already mounted
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Son olarak &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/mdadm.conf&lt;/code&gt; dosyasına RAID konfigürasyonunu yazdırıyoruz.&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# mdadm &lt;span class=&quot;nt&quot;&gt;--detail&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--scan&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--verbose&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/mdadm.conf

&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# &lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /etc/mdadm.conf
ARRAY /dev/md/0 &lt;span class=&quot;nv&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;raid1 num-devices&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;2 &lt;span class=&quot;nv&quot;&gt;metadata&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1.2 &lt;span class=&quot;nv&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;raid-1.sercangezer.com:0 &lt;span class=&quot;nv&quot;&gt;UUID&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;afbe95f1:9f76348b:004230dd:a9f6dc25
   &lt;span class=&quot;nv&quot;&gt;devices&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sdb1,/dev/sdc1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Artık RAID-1 cihazımız ile ilgili bilgi almak ve ya hata kontrolü yapmak için;&lt;/li&gt;
&lt;/ul&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;o&quot;&gt;[&lt;/span&gt;root@raid-1 ~]# mdadm &lt;span class=&quot;nt&quot;&gt;--detail&lt;/span&gt; /dev/md0

/dev/md0:
           Version : 1.2
     Creation Time : Thu Apr 13 17:52:28 2023
        Raid Level : raid1
        Array Size : 20953088 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;19.98 GiB 21.46 GB&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
     Used Dev Size : 20953088 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;19.98 GiB 21.46 GB&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent

       Update Time : Fri Apr 14 12:06:23 2023
             State : clean
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : resync

              Name : raid-1.sercangezer.com:0  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;to host raid-1.sercangezer.com&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
              UUID : afbe95f1:9f76348b:004230dd:a9f6dc25
            Events : 17

    Number   Major   Minor   RaidDevice State
       0       8       17        0      active &lt;span class=&quot;nb&quot;&gt;sync&lt;/span&gt;   /dev/sdb1
       1       8       33        1      active &lt;span class=&quot;nb&quot;&gt;sync&lt;/span&gt;   /dev/sdc1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
 </entry>
 
 <entry>
   <title>Ubuntu 22.04 Jenkins kurulum</title>
   <summary>Ubuntu 22.04 ortamında Jenkins servis olarak kurulumu</summary>
   <link href="https://www.sercangezer.com.tr/2023/ubuntu-22-jenkins-kurulum"/>
   <updated>2023-02-13T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/ubuntu-22-jenkins-kurulum</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;DevOps alemininde açık kaynak olarak kullanılan en yaygın CI/CD araçlarından biri olan Jenkins’in Ubuntu 22.04 üzerinde &lt;strong&gt;servis olarak&lt;/strong&gt; kurulumunu yapacağız.&lt;/p&gt;

&lt;h1 id=&quot;gereklilikler&quot;&gt;Gereklilikler&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Minimum donanımsal gereklilikler:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;256 MB Ram&lt;/li&gt;
  &lt;li&gt;10 GB Disk&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tavsiye edilen donanımsal gereklilikler:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;4 GB+ RAM&lt;/li&gt;
  &lt;li&gt;50 GB+ Disk&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Diğer:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;İnternet erişimi&lt;/li&gt;
  &lt;li&gt;Sudo yetkisi olan bir kullanıcı&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;kurulum&quot;&gt;Kurulum&lt;/h1&gt;

&lt;h2 id=&quot;jdk-kurulum&quot;&gt;JDK kurulum&lt;/h2&gt;

&lt;p&gt;Jenkins in çalışabilmesi için sistemimizde javanın yüklü olması gerekiyor.&lt;/p&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;nb&quot;&gt;sudo &lt;/span&gt;apt update &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;openjdk-11-jre &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Yüklendiğini kontrol etmek için;&lt;/p&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;java &lt;span class=&quot;nt&quot;&gt;-version&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#Çıktısı&lt;/span&gt;
openjdk version &lt;span class=&quot;s2&quot;&gt;&quot;11.0.12&quot;&lt;/span&gt; 2021-07-20
OpenJDK Runtime Environment &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;build 11.0.12+7-post-Debian-2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
OpenJDK 64-Bit Server VM &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;build 11.0.12+7-post-Debian-2, mixed mode, sharing&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;jenkins-kurulum&quot;&gt;JENKINS kurulum&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Öncelikle Jenkins’i indireceğimiz repoları sistemimize ekleyelim.&lt;/li&gt;
&lt;/ul&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;curl &lt;span class=&quot;nt&quot;&gt;-fsSL&lt;/span&gt; https://pkg.jenkins.io/debian-stable/jenkins.io.key | &lt;span class=&quot;nb&quot;&gt;sudo tee&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  /usr/share/keyrings/jenkins-keyring.asc &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /dev/null

&lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;deb &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;signed-by&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/share/keyrings/jenkins-keyring.asc] &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  https://pkg.jenkins.io/debian-stable binary/ | &lt;span class=&quot;nb&quot;&gt;sudo tee&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  /etc/apt/sources.list.d/jenkins.list &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /dev/null
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Şimdi Jenkins’i yükleyelim.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo &lt;/span&gt;apt-get update &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;jenkins &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Jenkins&lt;/code&gt; servis olarak eklenmiş mi kontrol edelim.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo &lt;/span&gt;systemctl status jenkins

&lt;span class=&quot;c&quot;&gt;#Çıktı&lt;/span&gt;
sercan@gezer:~&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;/lib/systemd/system/jenkins.service&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; enabled&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; vendor preset: enabled&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
     Active: active &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;running&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; since Mon 2023-02-13 06:46:48 UTC&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 1min 45s ago
   Main PID: 2674 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;java&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

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

&lt;ul&gt;
  &lt;li&gt;Port değiştirmek ve servisi sistem açıldığında başlatmak için aşağıdaki adımları uygulayabilirsiniz.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;port-değiştirmek&quot;&gt;Port değiştirmek&lt;/h3&gt;

&lt;p&gt;Varsayılan olarak &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;8080&lt;/code&gt; üzerinden erişebilirsiniz. Aşağıdaki parametreyi değiştirerek istediğiniz port üzerinden erişebilirsiniz. Bizim örneğimizde &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;8080&lt;/code&gt; –&amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;8081&lt;/code&gt; olarak değiştirilecek.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Jenkins servisimizi durduruyoruz.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo &lt;/span&gt;systemctl stop jenkins.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Portumuzu &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;8081&lt;/code&gt; olarak değiştiriyoruz.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; s+JENKINS_PORT&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;8080+JENKINS_PORT&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;8081+g /lib/systemd/system/jenkins.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Ayar dosyası değiştirdiğimiz için servise yeniden ayar dosyasını okutmamız gerekiyor.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo &lt;/span&gt;systemctl daemon-reload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Jenkins servisi aktif ediyoruz.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo &lt;/span&gt;systemctl start jenkins.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;sistem-başlangıcında-otomatik-çalıştırmak-için&quot;&gt;Sistem başlangıcında otomatik çalıştırmak için&lt;/h3&gt;

&lt;p&gt;Ubuntu sistemimiz yeniden başlatıldığında Jenkins’in de çalışır hale gelmesi için servisi aktif etmemiz gerekiyor.&lt;/p&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;nb&quot;&gt;sudo &lt;/span&gt;systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;jenkins.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Artık Jenkins ‘e internet tarayıcımızı kullanarak &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;8081&lt;/code&gt; portu üzerinden bağlanabiliriz.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;``http://IP_ADRESINIZ:8081`&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Açılan ekranda sizden ilk admin şifresi isteyecek onu Ubuntu üzerinden aşağıdaki kodu çalıştırarak elde edebilirsiniz.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo cat&lt;/span&gt; /var/lib/jenkins/secrets/initialAdminPassword

&lt;span class=&quot;c&quot;&gt;#Çıktı&lt;/span&gt;
d78a174351ce4c2fb59dbd65b8bed9c4 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Örnektir.&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Daha sonra kullanıcı oluşturup, pluginleri yüklediğinizde kurulumu tamamlamış oluyorsunuz.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;script-dosyası&quot;&gt;Script dosyası&lt;/h2&gt;

&lt;p&gt;Aşağıdaki script dosyasını kullanarak kolayca Ubuntu 22.04’e Jenkins kurabilirsiniz.&lt;/p&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;#!/bin/bash&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;java-jdk 11 yükleniyor.&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo sudo &lt;/span&gt;apt update &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;openjdk-11-jre &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-fsSL&lt;/span&gt; https://pkg.jenkins.io/debian/jenkins.io.key | &lt;span class=&quot;nb&quot;&gt;sudo tee&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  /usr/share/keyrings/jenkins-keyring.asc &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /dev/null

&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Jenkins repo oluşturuluyor...&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;deb &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;signed-by&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/share/keyrings/jenkins-keyring.asc] &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  https://pkg.jenkins.io/debian binary/ | &lt;span class=&quot;nb&quot;&gt;sudo tee&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  /etc/apt/sources.list.d/jenkins.list &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /dev/null

&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Jenkins yükleniyor..&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;jenkins &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;


&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Jenkins durduruluyor...&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl stop jenkins.service

&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Jenkins port 8081 olarak değiştiriliyor...&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; s+JENKINS_PORT&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;8080+JENKINS_PORT&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;8081+g /lib/systemd/system/jenkins.service

&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Ayarlar uygulanıyor.&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl daemon-reload

&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Jenkins servisi başlatılıyor.&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl start jenkins.service

&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Jenkins servisinin otomatik başlatılması...&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;jenkins.service

&lt;span class=&quot;c&quot;&gt;# Reset&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;NC&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;\033[0m&apos;&lt;/span&gt;       &lt;span class=&quot;c&quot;&gt;# Text Reset&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Bold&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;BCyan&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;\033[1;36m&apos;&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# Cyan&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;PAROLA&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo cat&lt;/span&gt; /var/lib/jenkins/secrets/initialAdminPassword&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Admin ilk şifremiz: &quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BCyan&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PAROLA&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NC&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Çalışan Podların CPU/Memory Request ve Limit bilgilerini görmek</title>
   <summary>Kubernetes ortamda çalışan Pod ve container ların CPU/Memory Request ve Limit bilgilerini ekrana yazdırmak</summary>
   <link href="https://www.sercangezer.com.tr/2023/kubernetes-pod-cpu-memory-request-limits-bilgileri"/>
   <updated>2023-02-09T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/Kubernetes-pod-cpu-memory-request-limits-bilgileri</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Kubernetes ortamda kaynak yönetimi yapmak istediğimizde baktığımız alanlardan biri de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CPU ve Memorylere tanımlanmış olan Request ve Limits bilgileri&lt;/code&gt;dir.&lt;/p&gt;

&lt;p&gt;Kısaca;&lt;/p&gt;

&lt;h2 id=&quot;cpumemory-request-nedir&quot;&gt;CPU/Memory Request nedir?&lt;/h2&gt;
&lt;p&gt;Container ın ayağa kalkması için sistemden ayrılmış olan CPU/Memory miktarı&lt;/p&gt;

&lt;h2 id=&quot;cpumemory-limits-nedir&quot;&gt;CPU/Memory Limits nedir?&lt;/h2&gt;
&lt;p&gt;Container ın kullanım sırasında ulaşacağa maksimum CPU/Memory miktarı, bu limiti aştığı zaman yeniden başlatılacaktır.&lt;/p&gt;

&lt;h2 id=&quot;yolu-path&quot;&gt;Yolu (Path)&lt;/h2&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;s&quot;&gt;spec.containers.resources.requests.cpu&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;spec.containers.resources.requests.memory&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;spec.containers.resources.limits.cpu&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;spec.containers.resources.limits.memory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;kullanabileceğimiz-komutlar&quot;&gt;Kullanabileceğimiz Komutlar&lt;/h2&gt;

&lt;p&gt;Aşağıdaki komutları kullanarak aktif olan pod lar üzerindeki bilgileri çekebiliriz.&lt;/p&gt;

&lt;p class=&quot;notice--info&quot;&gt;&lt;strong&gt;–all-namespaces&lt;/strong&gt; ibaresini &lt;strong&gt;-n NAMESPACE_ADI&lt;/strong&gt; olarak değiştirirseniz sadece istemiş olduğunuz namespace’de çalışan podların bilgilerini getirecektir.&lt;/p&gt;

&lt;h3 id=&quot;cpu-requests&quot;&gt;CPU Requests&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;kubectl get po &lt;span class=&quot;nt&quot;&gt;--all-namespaces&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;jsonpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;{range .items[*]}{.metadata.namespace}:{.metadata.name}{&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;}{range .spec.containers[*]}  {.name}:{.resources.requests.cpu}{&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;}{end}{&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;}{end}&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;cpu-limits&quot;&gt;CPU Limits&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;kubectl get po &lt;span class=&quot;nt&quot;&gt;--all-namespaces&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;jsonpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;{range .items[*]}{.metadata.namespace}:{.metadata.name}{&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;}{range .spec.containers[*]}  {.name}:{.resources.limits.cpu}{&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;}{end}{&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;}{end}&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;memory-requests&quot;&gt;Memory Requests&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;kubectl get po &lt;span class=&quot;nt&quot;&gt;--all-namespaces&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;jsonpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;{range .items[*]}{.metadata.namespace}:{.metadata.name}{&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;}{range .spec.containers[*]}  {.name}:{.resources.requests.memory}{&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;}{end}{&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;}{end}&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;memory-limits&quot;&gt;Memory Limits&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;kubectl get po &lt;span class=&quot;nt&quot;&gt;--all-namespaces&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;jsonpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;{range .items[*]}{.metadata.namespace}:{.metadata.name}{&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;}{range .spec.containers[*]}  {.name}:{.resources.limits.memory}{&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;}{end}{&apos;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;}{end}&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Saygılarımla,
Sağlıklı günler dilerim.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Failed to load SeLinux policy, Freezing hatası ve çözümü</title>
   <summary>Redhat based dağıtımlarda Failed to load SeLinux policy, Freezing hatası ve çözümü</summary>
   <link href="https://www.sercangezer.com.tr/2023/centos7-failed-to-load-selinux-policy-freezing-hatasi"/>
   <updated>2023-02-08T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/Centos7-failed-to-load-selinux-policy-freezing-hatasi</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Centos 7 kurulu sanal makinemi yeniden başlattığımda uzun bir süre bekledikten sonra açılmadığını fark ettim. Konsol a geçtiğim zaman &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Failed to load SELinux policy, Freezing.&lt;/code&gt; hatası alıp kesildiğini gördüm.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sercangezer/sercangezer.github.io/main/images/2023/20230208-Centos7-failed-to-load-selinux-policy-freezing01.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Biraz araştırmadan sonra SELinux tarafından kaynaklandığı yönünde bir çıkarımım oldu. Neyse ki daha önce başka kişilerin başına gelmiş bu sorun.&lt;/p&gt;

&lt;h1 id=&quot;çözüm&quot;&gt;Çözüm&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Sistemimizi yeniden başlatıyoruz.&lt;/li&gt;
  &lt;li&gt;Kernel listesine geldiğimiz zaman &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;e&lt;/code&gt; harfine basıyoruz.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sercangezer/sercangezer.github.io/main/images/2023/20230208-Centos7-failed-to-load-selinux-policy-freezing-kernel-list.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Açılan editör ekranında işaretli yere &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;selinux=0&lt;/code&gt; ibaresini ekliyoruz.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sercangezer/sercangezer.github.io/main/images/2023/20230208-Centos7-failed-to-load-selinux-policy-freezing-selinux-0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Daha sonra &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CTRL + X&lt;/code&gt; ile değişikliği uyguluyoruz ve sistemimiz yeniden başlıyor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;❗❗ Yukarıda yaptığımız değişiklik sistemimizi yeniden başlattığımız zaman siliniyor. Bu sebeple SELinux’ü disable a çekmemiz gerekiyor.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Aşağıdaki kod ile SELinux direkt olarak disable edebiliriz.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; s/^SELINUX&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;.&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$/SELINUX&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;disabled/ /etc/selinux/config
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Değişikliğin uygulanması için sistemimizi yeniden başlatmalıyız.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;sudo &lt;/span&gt;reboot now
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Saygılarımla,
Sağlıklı günler dilerim.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>(CKS) Dockerfile analizi</title>
   <summary>Dockerfile analizi ile güvenlik açıklarını kapatmak</summary>
   <link href="https://www.sercangezer.com.tr/2023/cks-dockerfile-analizi"/>
   <updated>2023-02-03T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/cks-dockerfile-analizi</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;İmaj güvenliği konusunda güvenliği arttırabilmemizin en güzel yolu; olabildiğince Dockerfile dosyasını sadeleştirmektedir.&lt;/p&gt;

&lt;h1 id=&quot;nasıl-dockerfile-sadeleştirebiliriz&quot;&gt;Nasıl Dockerfile sadeleştirebiliriz?&lt;/h1&gt;

&lt;p&gt;Örnek Dockerfile dosyamız;&lt;/p&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;s&quot;&gt;FROM nginx:latest&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;USER root&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;RUN apt-get update &amp;amp;&amp;amp; apt-get install -y wget&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;RUN apt-get update &amp;amp;&amp;amp; apt-get install -y curl&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;RUN apt-get update &amp;amp;&amp;amp; apt-get install -y phpadmin&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;RUN useradd -ms /bin/bash nginx-user&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;ENV db_password=DockerFileAnalyzer&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;USER root&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;ENTRYPOINT [&quot;/docker-entrypoint.sh&quot;]&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;EXPOSE &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;80&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;CMD [&quot;nginx&quot;, &quot;-g&quot;, &quot;daemon off;&quot;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;🔥 FROM ile kullanacağımız base ‘i &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;:latest&lt;/code&gt; etiketiyle değil, belirli bir sürümünü kullanmalıyız. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;:1.19.15&lt;/code&gt; gibi.&lt;/p&gt;

&lt;p&gt;🔥 Dockerfile içerisindeki &lt;strong&gt;en son USER direktifinin&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;root&lt;/code&gt; kullanıcısı olmamasına dikkat etmeliyiz.&lt;/p&gt;

&lt;p&gt;🔥 Gereksiz yazılımları yüklememeli ve fazladan layer (RUN direktifi) oluşturmamalıyız.&lt;/p&gt;

&lt;p&gt;🔥 Veritabanı şfiresi, kullanıcısı gibi hassas bilgileri Dockerfile eklememeli, kubernetes secret ile bu değerleri tanıtmalıyız.&lt;/p&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;s&quot;&gt;FROM nginx:1.19.15&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;USER root&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;RUN apt-get update &amp;amp;&amp;amp; apt-get install -y wget phpadmin&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;RUN useradd -ms /bin/bash nginx-user&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;USER nginx-user&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;ENTRYPOINT [&quot;/docker-entrypoint.sh&quot;]&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;EXPOSE &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;80&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;CMD [&quot;nginx&quot;, &quot;-g&quot;, &quot;daemon off;&quot;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>(CKS) Immutable Pod tanımlama</title>
   <summary>Kubernetes ortamda Immutable (Değişmez/Sabit) Pod tanımlama</summary>
   <link href="https://www.sercangezer.com.tr/2023/kubernetes-immutable-pod-tanimlama"/>
   <updated>2023-02-03T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/Kubernetes-immutable-pod-tanimlama</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Container Security Context konularından biri de Immutable Container konusu.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Immutable&lt;/code&gt; kelimesi basit anlamda değişmez/sabit anlamına gelmekle bizim konumuzda container çalışırken müdahale edilemeyen bir yapıda olması.&lt;/p&gt;

&lt;h1 id=&quot;kubernetes-ortamında-bir-container-ın-immutable-olma-şartları&quot;&gt;Kubernetes ortamında bir container ın immutable olma şartları;&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Container ların host (ana) makineye erişemediğinden emin ol.&lt;/li&gt;
&lt;/ul&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;securityContext.privileged&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;s&quot;&gt;` ~~&amp;gt; Varsayılan olarak `false` gelmektedir.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;privileged:true&lt;/strong&gt; olursa container içerisinden host makinesindeki processleri görebilir, erişebilir.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;Container ın içerisinde yetki yükseltmesine izin vermediğinden emin ol. (&lt;em&gt;root ya da sudo yetkisi olan bir kullanıcıyla oturum açamaması&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&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;container.securityContext.allowPrivilegeEscalation&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;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;ul&gt;
  &lt;li&gt;Container ın içerisinde &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;root&lt;/code&gt; kullanıcısı ve sudo yetkisi ile işlemler yapmasını engellediğine emin ol.&lt;/li&gt;
&lt;/ul&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;container.securityContext.runAsUser&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;999&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;container.securityContext.runAsGroup&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;999&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Container ın dosya sisteminin (Filesystem) sadece okuma yetkisi atandığından emin ol.&lt;/li&gt;
&lt;/ul&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;container.securityContext.readOnlyRootFilesystem&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;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;ul&gt;
  &lt;li&gt;❗❗ Eğer &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;container.securityContext.readOnlyRootFilesystem: true&lt;/code&gt; olarak uygularsak yazılımın kullanacağı cache, log gibi geçici olarak kullanacağı klasörleri empytDir olarak bağlamamız gerekir.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔥  &lt;a href=&quot;https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1&quot;&gt;&lt;em&gt;Kubernetes resmi dökümantasyondan okuyabilirsiniz&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1 id=&quot;uygulama&quot;&gt;Uygulama&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Aşağıdaki yaml da bulunan örnek podumuzu immutable hale çevirelim.&lt;/li&gt;
&lt;/ul&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;s&quot;&gt;cat &amp;lt;&amp;lt; EOF | kubectl apply -f -&lt;/span&gt; 
&lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;v1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Pod&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&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;immutable-olcak-pod&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;containers&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;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;nginx&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;s&quot;&gt;nginx:latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;securityContext&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;privileged&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;allowPrivilegeEscalation&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;runAsUser&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;runAsGroup&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;readOnlyRootFilesystem&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;s&quot;&gt;EOF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;İmmutable container a çevrilmiş hali.;&lt;/li&gt;
&lt;/ul&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;s&quot;&gt;cat &amp;lt;&amp;lt; EOF | kubectl apply -f -&lt;/span&gt; 
&lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;v1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Pod&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&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;immutable-olan-pod&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;containers&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;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;nginx&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;s&quot;&gt;nginx:latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;securityContext&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;privileged&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;c1&quot;&gt;# Silebiliriz ve ya false yapmalıyız..&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;allowPrivilegeEscalation&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;c1&quot;&gt;# Silebiliriz ve ya false yapmalıyız.&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;runAsUser&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;999&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# Silebiliriz ve ya başka kullanıcı id yapmalıyız.&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;runAsGroup&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;999&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# Silebiliriz ve ya başka grup id yapmalıyız.&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;readOnlyRootFilesystem&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;c1&quot;&gt;# True olarak yapmalıyız.&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;startupProbe&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#removes the bash shell&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;exec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;command&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;rm&lt;/span&gt;
            &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/bin/bash&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# Geçici olarak yazma ve çalıştırma yapacak klasörleri mount ettik.&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumeMounts&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;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;cache&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;mountPath&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/var/cache/nginx&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;run&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;mountPath&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/var/run&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;volumes&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;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;cache&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;emptyDir&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;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;run&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;emptyDir&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;EOF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
 </entry>
 
 <entry>
   <title>(CKS) Kubelet ve Kube-apiserver TLS Version ve Cipher atama</title>
   <summary>Kubernetes Kube-apiserver ve Kubelet için minimum TLS version ve Cipher atama</summary>
   <link href="https://www.sercangezer.com.tr/2023/kubelet-ve-kubeapiserver-tls-ayarlama"/>
   <updated>2023-02-01T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/kubelet-ve-kubeapiserver-tls-ayarlama</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;Sınavda &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Kubelet güvenliğine&lt;/code&gt; dair konu başlığı mevcut. Bu konuya örnek olması amacıyla biz;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;minimum TLS versiyonunun 12&lt;/li&gt;
  &lt;li&gt;TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 cipher ları atayacağız.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;kubelet&quot;&gt;Kubelet&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Öncelikle kubelet servisinin kullandığı config dosyasını bulalaım.&lt;/li&gt;
&lt;/ul&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;ps &lt;span class=&quot;nt&quot;&gt;-aux&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; kubelet

&lt;span class=&quot;c&quot;&gt;# Çıktısı&lt;/span&gt;
root       35493  3.7  1.5 1647572 122696 ?      Ssl  08:10   2:59 /usr/bin/kubelet &lt;span class=&quot;nt&quot;&gt;--bootstrap-kubeconfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/etc/kubernetes/bootstrap-kubelet.conf &lt;span class=&quot;nt&quot;&gt;--kubeconfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/etc/kubernetes/kubelet.conf &lt;span class=&quot;nt&quot;&gt;--config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/var/lib/kubelet/config.yaml &lt;span class=&quot;nt&quot;&gt;--container-runtime-endpoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;unix:///run/containerd/containerd.sock &lt;span class=&quot;nt&quot;&gt;--pod-infra-container-image&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;registry.k8s.io/pause:3.9
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Gördüğünüz gibi &lt;strong&gt;–config&lt;/strong&gt; parametresinde dosyanın yolu görünüyor. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--config=/var/lib/kubelet/config.yaml&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Önemli bir konfigürasyon dosyası olması sebebiyle yedeğini alalım.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;cp&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rvf&lt;/span&gt; /var/lib/kubelet/config.yaml ~/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Şimdi bir editör ile &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/var/lib/kubelet/config.yaml&lt;/code&gt; dosyamızı açalım ve aşağıdaki parametreleri dosyamızın en altına ekleyelim.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔥 &lt;a href=&quot;https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/&quot;&gt;&lt;em&gt;Parametrelerin açıklamalarının bulunduğu resmi döküman&lt;/em&gt;&lt;/a&gt;&lt;/p&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;tlsMinVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;VersionTLS12&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;tlsCipherSuites&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;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256&apos;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384&apos;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256&apos;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sercangezer/sercangezer.github.io/main/images/2023/20230201-kubeletconfig-tls-add.PNG&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Parametre eklerken bir yazım hatası yapmadıysanız kubelet servisi active olacaktır.&lt;/li&gt;
&lt;/ul&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;systemctl status kubelet

&lt;span class=&quot;c&quot;&gt;# Çıktısı&lt;/span&gt;
● kubelet.service - kubelet: The Kubernetes Node Agent
     Loaded: loaded &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;/usr/lib/systemd/system/kubelet.service&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; enabled&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; vendor preset: disabled&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    Drop-In: /usr/lib/systemd/system/kubelet.service.d
             └─10-kubeadm.conf
     Active: active &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;running&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;kube-apiserver&quot;&gt;Kube-apiserver&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Öncelikle kube-apiserver’ımızın yedeğini alalım.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;cp&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rvf&lt;/span&gt; /etc/kubernetes/manifests/kube-apiserver.yaml ~/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Şimdi bir editör ile &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/kubernetes/manifests/kube-apiserver.yaml&lt;/code&gt; dosyamızı açalım ve aşağıdaki parametreleri dosyamızın en altına ekleyelim.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔥 &lt;a href=&quot;https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/&quot;&gt;&lt;em&gt;Parametrelerin açıklamalarının bulunduğu resmi döküman&lt;/em&gt;&lt;/a&gt;&lt;/p&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;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;--tls-cipher-suites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;--tls-min-version=VersionTLS12&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sercangezer/sercangezer.github.io/main/images/2023/20230201-kube-apiserver-tls-add.PNG&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Parametre eklerken bir yazım hatası yapmadıysanız kube-apiserver podu bir süre sonra ayaklanacaktır.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ayaklanmaz ise logların hatanızı tespit edebilirsiniz.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>(CKS) Kubernetes Auditing Mekanizması</title>
   <summary>Kubernetes ortamında Auditing Logging mekanizması ile kubernetes güvenliğinin sağlanması</summary>
   <link href="https://www.sercangezer.com.tr/2023/kubernetes-auditing-kullanim"/>
   <updated>2023-01-31T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/kubernetes-auditing-kullanim</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Auditing&lt;/code&gt; dediğimiz olay, kubernetes cluster içerisinde sırasıyla güvenlikle ilgili konuları kaydeden bir loglama mekanizmasıdır.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;ne oldu?&lt;/li&gt;
  &lt;li&gt;Ne zaman oldu?&lt;/li&gt;
  &lt;li&gt;kim başlattı?&lt;/li&gt;
  &lt;li&gt;ne üzerine oldu?&lt;/li&gt;
  &lt;li&gt;nerede gözlemlendi?&lt;/li&gt;
  &lt;li&gt;nereden başlatıldı?&lt;/li&gt;
  &lt;li&gt;nereye gidiyordu?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;gibi soruların cevaplarını sürekli kaydederek, yönetici geriye dönük istediğini bulabilmesini sağlar.&lt;/p&gt;

&lt;p&gt;🔥 &lt;a href=&quot;https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/&quot;&gt;&lt;em&gt;[İngilizce] Kubernetes Auditing resmi dökümantasyonu&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1 id=&quot;kullanım&quot;&gt;Kullanım&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Aşağıdaki örnek policy.yaml dosyamızı indirelim. &lt;em&gt;(Sınavda hazır olarak policy.yaml dosyası veriliyor.)&lt;/em&gt;&lt;/li&gt;
&lt;/ul&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;wget https://raw.githubusercontent.com/kubernetes/website/main/content/en/examples/audit/audit-policy.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&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;nb&quot;&gt;cp&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rvf&lt;/span&gt; audit-policy.yaml /etc/kubernetes/audit-policy.yaml &lt;span class=&quot;c&quot;&gt;#Kubernetes ana dizinine taşıyoruz.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kube-apiserver.yaml&lt;/code&gt; dosyasına parametre girerek &lt;strong&gt;auditing&lt;/strong&gt; aktif etmemiz gerekiyor.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;cd&lt;/span&gt; /etc/kubernetes/manifests/ &lt;span class=&quot;c&quot;&gt;#Kube-apiserver dizinine gidiyoruz&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&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;nb&quot;&gt;cp&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rvf&lt;/span&gt; kube-apiserver.yaml ~/ &lt;span class=&quot;c&quot;&gt;#kube-apiserver.yaml dosyasımızın yedeğini başka bir yere alıyoruz.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Editör ile açarak aşağıdaki parametreleri ekliyoruz.&lt;/li&gt;
&lt;/ul&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;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;--audit-policy-file=/etc/kubernetes/audit-policy.yaml&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#Policy.yaml dosya yolu&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;--audit-log-path=/var/log/k8s-audit/k8s-audit.log&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#Logların yazılacağı log dosya yolu&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;--audit-log-maxage=30&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#Logların kaç günlük tutulacağı&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;--audit-log-maxbackup=10&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#Logların tutulacak yedek sayısı&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sercangezer/sercangezer.github.io/main/images/2023/20230131-kubernetes-auditing-kubeapiserver-parametre.PNG&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Kube-apiserver’ımızın logları yazacağı ve policy leri okuyacağı dosyaların bulunduğu dizinleri tanıması gerekiyor. Bu sebeple volumeMounts ve Volumes tanımlıyoruz.&lt;/p&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;volumeMounts&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;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;audit-config&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;mountPath&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/etc/kubernetes/audit-policy.yaml&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;readOnly&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;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;audit-log&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;mountPath&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/var/log/k8s-audit&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;readOnly&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;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sercangezer/sercangezer.github.io/main/images/2023/20230131-kubernetes-auditing-volumemounts-ekleme.PNG&quot; alt=&quot;&quot; /&gt;&lt;/p&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;volumes&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;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;audit-config&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;hostPath&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/etc/kubernetes/audit-policy.yaml&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;File&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;audit-log&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;hostPath&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/var/log/k8s-audit&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;DirectoryOrCreate&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sercangezer/sercangezer.github.io/main/images/2023/20230131-kubernetes-auditing-volumes-ekleme.PNG&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Herhangi bir hata yapmadan ekleme yaptıysanız aşağıdaki komut ile logları görebilirsiniz.&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;cat&lt;/span&gt; /var/log/k8s-audit/k8s-audit.log
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;❗ Eğer hata kube-apiserver.yaml eklerken hata yaparsanız api-server’a bağlanamayacağız için &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kubectl get pod&lt;/code&gt; dediğinizde hata alırsınız. Hata alıyorsanız yedek aldığınız orjinal kube-apiserver.yaml getirebilir onu tekrar editleyebilirsiniz.&lt;/p&gt;

&lt;p&gt;❗ &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/kubernetes/manifest&lt;/code&gt; altındaki statik podları editlerken mutlaka yedek almalısınız.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>(CKS) Falco ile konteynır davranışlarını izlemek</title>
   <summary>Kubernetes ortamında çalışan konteynırların Falco ile davranışlarını izlemek</summary>
   <link href="https://www.sercangezer.com.tr/2023/kubernetes-falco-kullanimi"/>
   <updated>2023-01-30T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/kubernetes-falco-kullanimi</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sercangezer/sercangezer.github.io/main/images/2023/20230130-kubernetes-falco-kullanimi-01.PNG&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Falco&lt;/code&gt;, uygulamalarınızı ve konteynırlarınızı izleyerek çalışma zamanında oluşan tehditleri algılar. Kısaca Kubernetes ortamında tehdit algılama aracı olarak düşünebiliriz.&lt;/p&gt;

&lt;h1 id=&quot;kurulum&quot;&gt;Kurulum&lt;/h1&gt;

&lt;p&gt;Ben Rocky Linux 9 üzerinde kurulum yapacağım.&lt;/p&gt;

&lt;p&gt;🔥 [&lt;em&gt;Diğer kurulumlar için resmi sayfası&lt;/em&gt;] (https://falco.org/docs/getting-started/installation/#centos-rhel)&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Yum repository dosyasını sistemimize ekleyiyoruz.&lt;/li&gt;
&lt;/ol&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;rpm &lt;span class=&quot;nt&quot;&gt;--import&lt;/span&gt; https://falco.org/repo/falcosecurity-packages.asc
curl &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /etc/yum.repos.d/falcosecurity.repo https://falco.org/repo/falcosecurity-rpm.repo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Uyumlu kernel headers dosyalarımızı yüklüyoruz.&lt;/li&gt;
&lt;/ol&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;yum &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;kernel-devel-&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;uname&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Falco’yu yüklüyoruz.&lt;/li&gt;
&lt;/ol&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;yum update &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; yum &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;falco

&lt;span class=&quot;c&quot;&gt;# Çalışmazsa denenebilir;&lt;/span&gt;
dnf &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--nogpgcheck&lt;/span&gt; falco &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Çalıştığına emin olmak için kontrol ediyoruz;&lt;/li&gt;
&lt;/ol&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;systemctl status falco
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;kullanım&quot;&gt;Kullanım&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Örnek bir pod oluşturalım.&lt;/li&gt;
&lt;/ul&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;s&quot;&gt;cat &amp;lt;&amp;lt; EOF | kubectl apply -f -&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;v1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Pod&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&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;falco-ornek-pod&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;containers&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;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;falco-ornek-konteynir&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;s&quot;&gt;busybox:1.36.0&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;command&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;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sh&apos;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-c&apos;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;true;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;cat&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/etc/shadow;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sleep&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;5;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;done&apos;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;EOF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;❗ Cluster bir yapı kurmadığım için direkt olarak podu hangi node üzerinde oluşturulduğunu biliyorum. Cluster bir yapınız mevcut ise podun özelliklerine bakarak öğrenebilirsiniz.;&lt;/p&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;kubectl describe pod falco-ornek-pod | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; Node:

&lt;span class=&quot;c&quot;&gt;#Çıktı&lt;/span&gt;
Node:             cks-master.sercangezer.com.tr/192.168.1.72
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Pod’un oluşturulduğu makineye SSH ile bağlanıyoruz.&lt;/li&gt;
  &lt;li&gt;Falco’nun kuralları yazdığımız &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/falco/falco_rules.local.yaml&lt;/code&gt; dosyasına aşağıdaki örnek kuralımızı ekliyoruz.&lt;/li&gt;
&lt;/ul&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;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rule&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;spawned_process_in_test_container&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;desc&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;A process was spawned in the falco test container.&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;condition&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;container.name = &quot;falco-ornek-konteynir&quot; and evt.type = execve&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;output&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;BIZIM&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;ORNEGIMIZ&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%evt.time,%user.uid,%proc.name,%container.id,%container.name&quot;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;priority&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;WARNING&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Ekledikten sonra falco’nun loglarından kontrol ediyoruz.&lt;/li&gt;
&lt;/ul&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;systemctl status falco

&lt;span class=&quot;c&quot;&gt;#Çıktı&lt;/span&gt;
Jan 31 08:33:10 cks-master.sercangezer.com.tr falco[27184]: 08:33:10.199588288: Warning BIZIM ORNEGIMIZ - 08:33:10.199588288,0,cat,adaab7654955,falco-ornek-konteynir
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&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;nb&quot;&gt;cat&lt;/span&gt; /var/log/falco | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; falco | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; BIZIM
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sercangezer/sercangezer.github.io/main/images/2023/20230130-kubernetes-falco-kullanimi-02.PNG&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;❗ &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/falco_rules.local.yaml&lt;/code&gt; dosyasına yazdığımız kurallar falco servisini yeniden başlatmadan direkt olarak uygular.&lt;/p&gt;

&lt;p&gt;❗ &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/falco_rules.yaml&lt;/code&gt; dosyasına yazdığımız kuralların uygulanması için falco servisinin yeniden başlatılması gerekmektedir.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>(CKS) Trivy, container imaj güvenlik açığı taramak</title>
   <summary>Kubernetes ortamında kullanılan imajların güvenlik açıklarını kontrol etmek</summary>
   <link href="https://www.sercangezer.com.tr/2023/trivy-ile-container-image-guvenlik-acigi-taramak"/>
   <updated>2023-01-28T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/trivy-ile-container-image-guvenlik-acigi-taramak</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/sercangezer/sercangezer.github.io/main/images/2023/trivy-ile-container-image-guvenlik-acigi-taramak-01.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Trivy&lt;/code&gt;: Kapsamlı ve çok yönlü bir güvenlik açığı tarayıcısıdır. Certified Kubernetes Security (CKS) sınavında &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;v0.19&lt;/code&gt; versionu kullanılıp sadece &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;imaj güvenlik taraması&lt;/code&gt; gerçekleştirmemiz yeterli.&lt;/p&gt;

&lt;p&gt;Daha fazla yetenekleri için &lt;a href=&quot;https://aquasecurity.github.io/trivy&quot;&gt;&lt;strong&gt;AquaSecurity Trivy resmi sitesini&lt;/strong&gt;&lt;/a&gt; inceleyebilirsiniz.&lt;/p&gt;

&lt;h1 id=&quot;kurulum&quot;&gt;Kurulum&lt;/h1&gt;

&lt;p&gt;Öncelikle birden fazla kurulum çeşidi vardır. Sınavda işletim sistemi üzerine paket kurulu olarak geliyor. Biz de o seneryoyu gerçekleştireceğiz.&lt;/p&gt;

&lt;p&gt;🔥 &lt;a href=&quot;https://aquasecurity.github.io/trivy/v0.19.2/getting-started/installation/&quot;&gt;&lt;em&gt;Diğer kurulum çeşitleri&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ben Rocky Linux üzerinde kurulumlar yapacağım.&lt;/p&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;nb&quot;&gt;sudo &lt;/span&gt;rpm &lt;span class=&quot;nt&quot;&gt;-ivh&lt;/span&gt; https://github.com/aquasecurity/trivy/releases/download/v0.19.2/trivy_0.19.2_Linux-64bit.rpm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Kurduğumuz versiyonu kontrol edelim.&lt;/p&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;trivy &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#Output&lt;/span&gt;
Version: 0.19.2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;kullanım&quot;&gt;Kullanım&lt;/h1&gt;

&lt;p&gt;Öncelikle örnek deployment ‘ımızı çalıştıralım.&lt;/p&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;s&quot;&gt;cat &amp;lt;&amp;lt; EOF | kubectl apply -f -&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;apps/v1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Deployment&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&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;trivy-ornek-deployment&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;labels&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;trivy&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;replicas&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;matchLabels&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;trivy&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;metadata&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;labels&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;trivy&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;containers&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;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;nginx&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;s&quot;&gt;nginx:1.14.2&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;ports&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;containerPort&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;80&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;ruby&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;s&quot;&gt;ruby:2.4.0&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;alpine&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;s&quot;&gt;alpine:latest&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;EOF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Deployment ımızda kullanılan imajlara bir göz atalım.&lt;/p&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;kubectl describe deployments.apps trivy-ornek-deployment | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; image:

&lt;span class=&quot;c&quot;&gt;#Çıktı&lt;/span&gt;
    Image:        nginx:1.14.2
    Image:        ruby:2.4.0
    Image:        alpine:latest
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Kullanılan imajların bütün güvenlik açıklarını taratmak için;&lt;/p&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;trivy image nginx:1.14.2

trivy image ruby:2.4.0

trivy image alpine:latest
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Kullanılan imajların derecesine göre  güvenlik açıklarını taratmak için;&lt;/p&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;# nginx:1.14.2 sürümünde HIGH seviyesindeki güvenlik açıklarını listeler&lt;/span&gt;
trivy image &lt;span class=&quot;nt&quot;&gt;--severity&lt;/span&gt; HIGH nginx:1.14.2

&lt;span class=&quot;c&quot;&gt;# ruby:2.4.0 sürümünün HIGH ve CRITICAL güvenlik açıklarını listeler&lt;/span&gt;
trivy image &lt;span class=&quot;nt&quot;&gt;--severity&lt;/span&gt; HIGH,CRITICAL ruby:2.4.0

&lt;span class=&quot;c&quot;&gt;# alpine:latest sürümünde sadece OS (işletim sistemine) ait açıkları listeler&lt;/span&gt;
trivy image &lt;span class=&quot;nt&quot;&gt;--vuln-type&lt;/span&gt; os alpine:latest
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>(CKS) RuntimeClass atamak</title>
   <summary>Kubernetes ortamda Pod&apos;a RuntimeClass atamak</summary>
   <link href="https://www.sercangezer.com.tr/2023/kubernetes-runtimeclass-tanimlamak"/>
   <updated>2023-01-27T00:00:00+03:00</updated>
   <id>https://www.sercangezer.com.tr/2023/kubernetes-runtimeclass-tanimlamak</id>
   <content type="html">&lt;p&gt;Esenlikler,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RuntimeClass&lt;/strong&gt;lar basit anlamda, bir sanal makinenin içerisinde çalışan ve kendine ait izole kernel’i olan container’lar olrak düşünebiliriz. Host (Ana) makinenin kerneline erişim sağlayamaz.&lt;/p&gt;

&lt;h2 id=&quot;runtime-kontrol-etmek&quot;&gt;Runtime kontrol etmek&lt;/h2&gt;

&lt;p&gt;Sisteminizde kullanılan runtimeClass’ı görmek için;&lt;/p&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;crictl&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;docker&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; info | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; defaultRuntimeName

&lt;span class=&quot;c&quot;&gt;#Output&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&quot;defaultRuntimeName&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;runc&quot;&lt;/span&gt;,
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 id=&quot;kullanabileceğimiz-runtimelar&quot;&gt;Kullanabileceğimiz runtime’lar&lt;/h2&gt;

&lt;p&gt;Diğer runtime’ları kullanabilmek için öncelikle sisteme yükleyip gerekli konfigürasyonları yapmak gerekiyor. Kullanabileceğiniz bazı runtime’lar;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://gvisor.dev/docs/user_guide/install/&quot;&gt;&lt;strong&gt;gVisor&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/containers/crun&quot;&gt;&lt;strong&gt;crun&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/kata-containers/kata-containers&quot;&gt;&lt;strong&gt;kata&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;runtimeclass-objesi-oluşturmak&quot;&gt;RuntimeClass objesi oluşturmak&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://kubernetes.io/docs/concepts/containers/runtime-class/#2-create-the-corresponding-runtimeclass-resources&quot;&gt;&lt;strong&gt;Kubernetes resmi dökümanlarında&lt;/strong&gt;&lt;/a&gt; verilmiş olan yaml’ı alarak düzenliyoruz.&lt;/p&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;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;node.k8s.io/v1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;RuntimeClass&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# RuntimeClass objesi namespace almaz.&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# RuntimeClass&apos;ımızın ismi&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;myclass&lt;/span&gt; 
&lt;span class=&quot;c1&quot;&gt;# CRI ayarında girilen konfigürasyon&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;handler&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;myconfiguration&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Crun&lt;/strong&gt; için;&lt;/p&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;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;node.k8s.io/v1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;RuntimeClass&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&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;crun&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;handler&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;crun&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;gVisor&lt;/strong&gt; için;&lt;/p&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;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;node.k8s.io/v1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;RuntimeClass&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&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;gvisor&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;handler&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;runsc&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Kata-container&lt;/strong&gt; için;&lt;/p&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;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;node.k8s.io/v1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;RuntimeClass&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&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;kata&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;handler&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;kata&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;poda-runtimeclass-eklemek&quot;&gt;Pod’a runtimeClass eklemek&lt;/h2&gt;

&lt;p&gt;Herhangi bir pod’umuza &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;spec.runtimeClassName&lt;/code&gt; özelliğini ekleyerek, izole ediyoruz. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gVisor&lt;/code&gt; runtime ‘ını ele alırsak;&lt;/p&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;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;v1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Pod&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&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;nginx&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;runtimeClassName&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;gvisor&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#Eklenen&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;containers&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;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;nginx&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;s&quot;&gt;nginx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;kontrol-etmek&quot;&gt;Kontrol etmek&lt;/h2&gt;

&lt;p&gt;Podun çalıştığı makineyeye giderek&lt;/p&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;ps &lt;span class=&quot;nt&quot;&gt;-aux&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; runc

&lt;span class=&quot;c&quot;&gt;#Output&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#Nginx podunu göremeyeceğiz.&lt;/span&gt;

ps &lt;span class=&quot;nt&quot;&gt;-aux&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; runsc

&lt;span class=&quot;c&quot;&gt;#Output&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#Nginx podunu göreceğiz.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://kubernetes.io/docs/concepts/containers/runtime-class/&quot;&gt;&lt;em&gt;[İngilizce]Kubernetes Dökümantasyonu - RuntimeClass&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 

</feed>
