<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alptekin YANIK on Medium]]></title>
        <description><![CDATA[Stories by Alptekin YANIK on Medium]]></description>
        <link>https://medium.com/@alptekin_ynk?source=rss-9eded450f578------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NZ2N_n3PvBkMzOES6pzj3g.jpeg</url>
            <title>Stories by Alptekin YANIK on Medium</title>
            <link>https://medium.com/@alptekin_ynk?source=rss-9eded450f578------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 21:01:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alptekin_ynk/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Prometheus Monitoring]]></title>
            <link>https://medium.com/@alptekin_ynk/prometheus-monitoring-5ce5ac059600?source=rss-9eded450f578------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ce5ac059600</guid>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[prometheus-operator]]></category>
            <category><![CDATA[prometheus-monitoring]]></category>
            <dc:creator><![CDATA[Alptekin YANIK]]></dc:creator>
            <pubDate>Fri, 26 May 2023 11:25:14 GMT</pubDate>
            <atom:updated>2023-05-26T11:25:14.687Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nvbYNSOfCASp-FzH77bFNw.png" /></figure><h3>Introduction</h3><p>In today’s complex and dynamic systems, monitoring and managing rapidly growing infrastructures are of vital importance for businesses. This is where a powerful tool like Prometheus monitoring comes into play. Prometheus, as a modern open-source monitoring and alerting system, enables effective tracking of the performance, resource utilization, and errors of complex systems. In this blog post, we will explore what Prometheus monitoring is, how it works, and why it has become an essential tool in today’s competitive business environment. We will also delve into the significant features and use cases offered by Prometheus, providing readers with a perspective on how they can better understand and utilize this powerful monitoring tool. If you’re ready, let’s step into the world of Prometheus monitoring and discover how this exciting technology adds value to businesses.</p><h3>Brief History</h3><p>Prometheus originated in 2012 at SoundCloud, a music-sharing platform. Developed by Julius Volz, Matt T. Proud, and Björn Rabenstein, Prometheus was created to effectively monitor SoundCloud’s complex infrastructure. In the following years, Prometheus was released as an open-source project and adopted by a large community. Accepted by the Cloud Native Computing Foundation (CNCF) in 2015, Prometheus quickly gained popularity and became an industry standard. Today, Prometheus monitoring is a reliable and scalable monitoring solution used by many leading companies and organizations.</p><h3>Architecture</h3><p>Prometheus monitoring operates on a client-server architecture. In this architecture, the Prometheus server collects and processes data while Prometheus clients gather metrics from target systems (applications, servers, databases, etc.) and provide monitoring data to the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*82mUDUYGmcLFht2CKObyvw.png" /><figcaption>prometheus architecture</figcaption></figure><p>The Prometheus server collects metrics by sending requests to target systems at regular intervals. These metrics are presented by the target systems as predefined measurements, counters, histograms, and summaries. The server stores these metrics in a database and serves them to clients in response to queries.</p><h3>Prometheus Server</h3><p>The Prometheus server consists of important components: TSDB (Time Series Database), retrieval, and HTTP server.</p><h4>TSDB</h4><p>The TSDB serves as the main database of the Prometheus server, storing time-series data. It compresses the changing values of metrics over time and stores the compressed data on disk in an optimized manner. This enables efficient management and querying of large amounts of time-series data. The indexing mechanism within TSDB allows for fast execution of queries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*xsFad-DzojXmHY615-6L_A.png" /><figcaption>metrics</figcaption></figure><h4>Retrieval</h4><p>Retrieval refers to the Prometheus server’s capability to process metric requests to target systems. The server sends requests to target systems at specific intervals over HTTP or other protocols and collects metrics. The retrieval process involves gathering and transmitting data from the target systems. Prometheus clients running on the target systems collect metrics and send them to the server.</p><h4>HTTP server</h4><p>The HTTP server is a component that enables communication between the Prometheus server and the outside world. It fulfills the functions of querying and providing metric data to users through the APIs offered by Prometheus. Users can send queries to the Prometheus server via HTTP to retrieve metric data for specific time ranges or visualize it graphically. The HTTP server acts as an open interface for the Prometheus server, facilitating users’ access to metric data.</p><p>These components work together to enable the functioning of the Prometheus server. TSDB stores and optimizes time-series data for efficient querying, retrieval collects data from target systems, and the HTTP server facilitates communication with the outside world by serving metric data. In this way, Prometheus operates as an effective monitoring and analysis solution, providing users with the ability to monitor and manage their systems’ performance.</p><h3>AlertManager</h3><p>AlertManager, an important component of Prometheus monitoring, is a tool that provides automatic alarm management for monitoring data. It receives, groups, filters, and organizes alert conditions received from the Prometheus server. It can then forward notifications about these alert conditions to various targets such as email, Slack, PagerDuty, Webhook, etc.</p><p>AlertManager offers a flexible structure to manage complex alarms and configure alarm notifications according to users’ preferences. The alarm grouping feature allows users to gain a better perspective by consolidating similar or related alarms. For example, it is possible to gather different errors coming from the same target server under a single group.</p><h3>Prometheus Web UI</h3><p>Prometheus Web UI is the user interface of the Prometheus server, providing visualization, querying, and data exploration capabilities for monitoring data. The Web UI facilitates the graphical display of metrics, executing queries, and conducting data discovery. Users can visually examine time series of metrics, compare different time intervals, and perform deeper analysis with custom queries through the Web UI.</p><p>On the other hand, Grafana is a monitoring and visualization tool similar to Prometheus but with a broader ecosystem. Grafana collects data from various data sources such as Prometheus, InfluxDB, Elasticsearch, etc., and enables users to visualize this data. The primary purpose of Grafana is to provide a comprehensive monitoring and visualization experience by consolidating multiple data sources in one place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vrzf-FFnrxXlu4asJxU32w.png" /><figcaption>grafana dashboard</figcaption></figure><p>Grafana has several significant differences compared to the Prometheus Web UI.</p><ul><li>It offers a wider ecosystem by supporting multiple data sources, allowing data retrieval from different monitoring systems and databases and unifying them in a single interface.</li><li>Grafana provides users with advanced graphing and visualization capabilities. Its extensive collection of graph panels and customization options enable users to visualize metric data in a more flexible way. Additionally, users can create interactive dashboards, real-time status tables, gauge panels, receive instant alerts, and share dashboards.</li><li>Grafana offers a broader solution for monitoring the overall system status and integrating multiple data sources. It allows the consolidation of data from multiple Prometheus servers or different databases, enabling centralized management on a single visualization platform.</li></ul><h3>Metric Collection</h3><p>Prometheus generally utilizes the “pull” model for collecting metrics. This model enables the Prometheus server to collect metrics by making requests to target systems. However, in cases where the target systems cannot directly transmit metrics to the Prometheus server, specialized components called “exporters” are employed.</p><p>Exporters are agents placed on the target systems to facilitate metric collection by the Prometheus server. These agents monitor the status, performance, or custom metrics of the target systems and present metrics in a format understandable by the Prometheus server.</p><p>Exporters are available as pre-built solutions for various target systems. For example, Node Exporter is used to collect hardware, operating system, and network metrics from Linux or Unix-based systems. More exporter examples can be found in the official Prometheus documentation (<a href="https://prometheus.io/docs/instrumenting/exporters/">https://prometheus.io/docs/instrumenting/exporters/</a>).</p><p>Exporters present the collected metrics to the Prometheus server via the HTTP protocol. The Prometheus server triggers requests to these exporters within specific intervals and retrieves the metrics. By using different exporters for different applications or components running on the target systems, the Prometheus server can collect a wide range of metrics. Thus, using the Prometheus pull model and exporters allows for the collection and monitoring of widely used metrics in a diverse system ecosystem.</p><h3>Pushgateway</h3><p>The Pushgateway is a component that enables data pushing to the Prometheus monitoring system. Unlike the traditional client-server model, it allows clients to push their metrics to the server through the Pushgateway instead of directly sending them to the Prometheus server.</p><p>The Pushgateway is particularly suitable for short-term or transient workloads. For example, in cases such as threads, background tasks, or short-lived processes, data can be sent to the server through the Pushgateway instead of continuously sending it to Prometheus. This allows tracking and analysis of transient or rapidly changing metrics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*oF9qAs4KuU9sXA_IeSu_MQ.png" /><figcaption>pushgateway</figcaption></figure><p>The Pushgateway enables clients to send metrics to the server via HTTP POST requests. Clients send data to the Pushgateway by specifying the metrics and their associated labels. The Pushgateway temporarily stores the received metrics in memory and collects this data when requested by the Prometheus server.</p><p>The Prometheus server periodically sends requests to the Pushgateway and retrieves the available metric data. These requests ensure that the Pushgateway is registered as a target to the server. Prometheus regularly scrapes and stores the received data in the TSDB (Time Series Database). As a result, metrics sent through the Pushgateway are included in Prometheus’ queryable database.</p><p>An important feature of the Pushgateway is the ability to modify the labels used for grouping and deleting metrics. This simplifies the grouping and management of metrics sent through the Pushgateway.</p><p>The Pushgateway serves as a tool for special cases in the Prometheus monitoring ecosystem and facilitates client-driven metric submission. However, for collecting long-term and persistent metrics, it is recommended to have clients push metrics directly to the Prometheus server.</p><p>By adding the capability of client-based metric submission to the Prometheus monitoring system, the Pushgateway facilitates the tracking and analysis of transient or rapidly changing metrics.</p><h3>Konfigürasyon</h3><p>The configurations of Prometheus are stored in the prometheus.yml file located in the working directory of the Prometheus server. This file serves as the basic configuration file that determines how Prometheus behaves at runtime. It is possible to monitor Prometheus itself by configuring this file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*Up1bv_teYIlYtkeiewvvMw.png" /><figcaption>prometheus.yaml</figcaption></figure><p>The Prometheus configuration file consists of the following sections:</p><ul><li>global: Contains general configuration settings. This section includes settings like scrape_interval (the frequency of metric collection), evaluation_interval (the frequency of rule evaluation), and external_labels</li><li>rule_files: This section contains additional Prometheus-specific rules to be loaded. You can define custom rules to be applied by the Prometheus server in this section.</li><li>scrape_configs: This section defines the targets that Prometheus will monitor to collect metrics. Each scrape configuration contains the necessary information to retrieve metrics from a target system or service.</li></ul><h3>Prometheus Operator and kube-prometheus</h3><p>Prometheus Operator, Kubernetes ortamlarında ölçeklenebilir ve yönetilebilir bir şekilde Prometheus ve diğer ek bileşenlerin kurulumunu sağlayan popüler araçlardır. kube-prometheus, Prometheus Operator’ü kullanarak Prometheus, Alertmanager, Grafana ve diğer bazı bileşenlerin birlikte çalışabilir bir şekilde Kubernetes üzerinde dağıtılmasını sağlar. Bu sayede, Kubernetes altyapınızdaki kaynakları izleyebilir, metrikleri toplayabilir, uyarılar oluşturabilir ve izleme panoları oluşturabilirsiniz. Bu sayede Prometheus ve diğer bileşenler kolay bir şekilde kurulabilir ve yönetilebilir.</p><p>Prometheus Operator and kube-prometheus are popular tools that enable scalable and manageable deployment of Prometheus and other related components in Kubernetes environments. kube-prometheus utilizes Prometheus Operator to deploy Prometheus, Alertmanager, Grafana, and other components together in a cohesive manner on Kubernetes. This allows you to monitor resources, collect metrics, create alerts, and build dashboards in your Kubernetes infrastructure. With Prometheus Operator and other components, installation and management of Prometheus become easier.</p><p>The only requirement for installation is a Kubernetes cluster accessible through kubectl.</p><pre># We are downloading the kube-prometheus project.<br>git clone https://github.com/prometheus-operator/kube-prometheus.git</pre><pre># To deploy the application, we first apply the following command. This command will create the &quot;monitoring&quot; namespace within the cluster.<br>kubectl create -f manifests/setup</pre><pre># After the ServiceMonitor is created, you will see the message &quot;No resources found&quot; on the screen. After this message, apply the following command.<br>until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo &quot;&quot;; done</pre><pre>kubectl create -f manifests/</pre><pre># Once the application is up and running, you can access Prometheus by forwarding port 9090 to your local machine<br>kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090</pre><pre># Similarly, you can set up port forwarding for Alertmanager and Grafana as well<br>kubectl --namespace monitoring port-forward svc/alertmanager-main 9093<br>kubectl --namespace monitoring port-forward svc/grafana 3000</pre><p>Referanslar</p><ul><li><a href="https://prometheus.io/docs/alerting/latest/alertmanager/">https://prometheus.io/docs/alerting/latest/alertmanager/</a></li><li><a href="https://prometheus.io/docs/tutorials/getting_started/#basic-architecture-of-prometheus">https://prometheus.io/docs/tutorials/getting_started/#basic-architecture-of-prometheus</a></li><li><a href="https://prometheus.io/docs/instrumenting/exporters/">https://prometheus.io/docs/instrumenting/exporters/</a></li><li><a href="https://prometheus-operator.dev/docs/prologue/quick-start/">https://prometheus-operator.dev/docs/prologue/quick-start/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ce5ac059600" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Genel Kavramlar -1 (Master Node)]]></title>
            <link>https://medium.com/@alptekin_ynk/kubernetes-genel-kavramlar-1-master-node-de0308f0cfb6?source=rss-9eded450f578------2</link>
            <guid isPermaLink="false">https://medium.com/p/de0308f0cfb6</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker-kubernetes]]></category>
            <category><![CDATA[kubernetes-management]]></category>
            <category><![CDATA[orchestration]]></category>
            <dc:creator><![CDATA[Alptekin YANIK]]></dc:creator>
            <pubDate>Sat, 03 Sep 2022 15:06:11 GMT</pubDate>
            <atom:updated>2022-09-03T15:06:43.394Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iYiyMM18W5kZYFsjAOrh2A.png" /></figure><p>Günümüzde uygulamalarda kullanımı gittikçe yaygınlaşan konteyner kavramı bir çok yeni kavramı ve ihtiyacı beraberinde getirdi. Docker ile konteyner uygulamalar geliştirmek, bu konteynerlerin yönetim ihtiyacını da beraberinde getirdi. Kubernetes, Volcano ve Crossplane gibi araçlar konteynerler üzerinde “Orchestration” dediğimiz yönetim ihtiyacını karşıladı. Bu yazı dizisinde Kubernetes öğrenmek isteyenler için başlangıç niteliğinde olan genel kavramları anlatacağım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*Z38KP_cMeEBmJNqJiHta2Q.png" /></figure><p>Öncelikle genel kültür olması amacıyla kubernetes’in logosu hakkında bilgi vermek istiyorum. Kubernetes ismi aslında logoda da gördüğümüz ve Yunanca kökenli olan ve “dümenci” anlamına gelen bir kelimeden almaktadır. Dümen içerisinde 7 adet kol bulunmaktadır ki aslında bu da kubernetes’i geliştiren ekibin projenin ilk adı olan “Project Seven” ismine bir göndermedir. Bazı kaynaklarda kubernetes ismi yerine ”kube” veya “k8s” görebilirsiniz. Bu “K” ve “S” harfleri arasında 8 harf bulunmasından kaynaklanan farklı bir isimlendirmedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0YuvVAZIrGgZyzewhdSnSQ.png" /></figure><p>Kubernetes ve Docker kavramları anlatılırken en çok kullanılan analojilerden biri konteyner gemileridir. Bu şekilde açıklayacak olursak, basitçe Docker uygulamalarımızı “containerize” etmemizi sağlayan bir araçtır. Bu konteynerlerin nereye gideceği, hangi gemiye yükleneceği, hangi gemide kaç adet konteyner olacağı ve daha birçok sorunun cevabı kubernetes içindedir.</p><p>Kubernetes mimarisine genel bir bakış atacak olursak. En temel hali ile kubernetes içerisinde 2 adet node bulunur. Bunlardan biri konteynerlerımızı taşıyan, “worker” nodelardır. Diğeri ise bu “worker” nodelarımızı yönetmemizi sağlayan “master” nodedur. Yani bu iki node arasında master-slave ilişkisi bulunmaktadır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gcgaV7JWoKNIIhbCAypj5Q.png" /></figure><p>Master node mimarisini inceleyecek olursak, 4 temel parçaya ayrıldığını görebiliriz. Bunlar</p><ul><li>Kube-apiserver</li><li>Control Manager</li><li>ETCD</li><li>Kube-scheduler</li></ul><p>Kube-apiserver kubernetes’in birincil yönetim bileşenidir. Node içerisindeki tüm işlemleri düzenlemekten sorumludur. Nodeların durumunu izlemek ve master node içerisindeki diğer bileşenlerin worker nodelar ile iletişim kurmasını sağlar.</p><p>ETCD, master node içerisinde bir veritabanı görevi görür. Normal bir veritabanı gibi çalışmaz. Değerleri “key-value” biçiminde bünyesinde saklar. Node ve üzerinde bulunan konteynerlar hakkındaki her türlü bilgi ETCD içerisinde bulunmaktadır. Kubernetes komutlarından biri olan <strong>~kubectl get</strong> .. komutu ile gelecek her türlü bilgi ETCD tarafından sağlanmaktadır.</p><p>Konteyner gemisi analojisine dönecek olursak. Konteynerların hangi gemiye yükleneceği, geminin boyutuna, kapasitesine ve geminin varış noktasına göre değişebilir. Doğru gemiye doğru konteynerı yüklemek ve bunların denetimini yapmak “Kube-scheduler” ın görevidir.</p><p>Controller Manager bileşeninin içerinde bir çok farklı “controller” bulunmaktadır. Worker node üzerinden bulunan konteynerlerin durumu ve bunların kullanılmaz hale gelmesi durumunda yenilerinin üretilmesi veya hasar görmüş olanların yok edilmesi gibi kararların verildiği yer Controller Manager bileşenidir.</p><p>Tüm bu bileşenlerin kendi arasındaki iletişim kube-apiserver üzerinden sağlanmaktadır.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de0308f0cfb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>