<?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 Jinha Jeong on Medium]]></title>
        <description><![CDATA[Stories by Jinha Jeong on Medium]]></description>
        <link>https://medium.com/@jinha4ever?source=rss-b2d7f3871c5b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QHsMA7FOzK7wa6Fu</url>
            <title>Stories by Jinha Jeong on Medium</title>
            <link>https://medium.com/@jinha4ever?source=rss-b2d7f3871c5b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 12:27:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jinha4ever/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[Debugging React Hook Form & Zod: Understanding how defaultValues and unregister work]]></title>
            <link>https://medium.com/@jinha4ever/debugging-react-hook-form-zod-understanding-how-defaultvalues-and-unregister-work-74b54813de0d?source=rss-b2d7f3871c5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/74b54813de0d</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-hook-form]]></category>
            <category><![CDATA[zod]]></category>
            <dc:creator><![CDATA[Jinha Jeong]]></dc:creator>
            <pubDate>Sun, 27 Apr 2025 07:36:39 GMT</pubDate>
            <atom:updated>2025-04-27T07:36:39.762Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5v7szqJzWmfbIbmM4XqFyg.png" /></figure><p>Recently, I encountered a validation error while using <a href="https://react-hook-form.com/">React Hook Form</a>.<br>Even though I set a defaultValue for the field and it appeared correctly in the UI, the form still failed validation when I submitted it.</p><p>I used the following code to quickly check which fields were causing validation errors, and found that the specific field was indeed the source of the problem:</p><pre>console.log({ error: form.formState.errors })</pre><p>It consisted of two properties: type and condition.</p><pre>const ExampletSchema = z.object({<br>  type: z.literal(&quot;EXAMPLE_TYPE&quot;),<br>  condition: z.union([<br>    z.object({ fieldA: z.array(z.string()).min(1) }),<br>    z.object({ fieldB: z.array(z.string()).min(1) }),<br>    z.object({ fieldA: z.array(z.string()).min(1), fieldB: z.array(z.string()).min(1) }),<br>  ]),<br>}).optional()</pre><p>While trying to fix this validation error, I was able to deepen my understanding of how React Hook Form works. Here’s a breakdown of my debugging process.</p><ol><li><a href="https://react-hook-form.com/docs/useform">defaultValues</a> is a recommended way to set up your form’s initial values. And these are applied only once at mount. This made me suspect there was code unintentionally modifying or removing the field’s value upon unmount.</li><li><a href="https://react-hook-form.com/docs/useform/unregister">unregister</a> will remove the field from validation and form submission. However, if the input is still mounted and registered with the register callback, it will be registered again automatically.</li></ol><blockquote><a href="https://react-hook-form.com/docs/useform/unregister">Make sure you unmount that input which has </a><a href="https://react-hook-form.com/docs/useform/unregister">register callback or else the input will get registered again.</a></blockquote><p>3. That’s when I realized that I had this input registered:</p><pre>&lt;input {…register(&quot;exampleField.type&quot;)} /&gt;</pre><p>Then I also found this piece of code that attempts to unregister the field</p><pre>  useEffect(() =&gt; {<br>    return () =&gt; unregister(&quot;exampleField&quot;)<br>  }, [unregister])</pre><p>4. Although exampleField was unregistered, exampleField.type was automatically registered again — this is how React Hook Form behaves when an input remains mounted.<br>According to the Zod schema I defined, the field should be considered optional when both type and condition properties are missing. However, because the type property was re-registered by the input, the optional check passed, and the form proceeded to validate the condition property instead.</p><p>5. I removed the register call for exampleField.type because the value was already set through defaultValues, making additional registration redundant.</p><pre>// &lt;input {…register(&quot;exampleField.type&quot;)} /&gt;</pre><p>6. I also removed the unregister call, because if the field is not selected, its option should still be omitted explicitly in the database. If the field is unregistered, it gets excluded entirely from the submission payload, making it difficult to update the record properly.</p><pre>// useEffect(() =&gt; {<br>//     return () =&gt; unregister(&quot;exampleField&quot;)<br>// }, [unregister])</pre><p>7. Additionally, I updated the toggle handler to explicitly set the field to null when the user disables the option. Here’s the updated schema and added toggle handler:</p><pre>const ExampletSchema = z.object({<br>  type: z.literal(&quot;EXAMPLE_TYPE&quot;),<br>  condition: z.union([<br>    z.object({ fieldA: z.array(z.string()).min(1) }),<br>    z.object({ fieldB: z.array(z.string()).min(1) }),<br>    z.object({ fieldA: z.array(z.string()).min(1), fieldB: z.array(z.string()).min(1) }),<br>  ]),<br>})<br>.nullable()<br>.transform(nullToUndefined)</pre><pre>onSwitchChange={(toggle) =&gt; {<br>  if (!toggle) {<br>    field.onChange(null)<br>  } else {<br>    field.onChange({<br>      type: &quot;EXAMPLE_TYPE&quot;,<br>      condition: { fieldA: [&quot;EXAMPLE&quot;] },<br>    })<br>  }<br>}}</pre><p>This debugging experience helped me better understand how React Hook Form manages field registration and validation. Seeing the cleaned-up code after solving the issue was incredibly satisfying. I hope this article helps anyone who might be stuck with a similar issue.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74b54813de0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accessing the kubernetes Service in the Default Namespace from Your Pods]]></title>
            <link>https://medium.com/@jinha4ever/accessing-the-kubernetes-service-in-the-default-namespace-from-your-pods-976d60326fbd?source=rss-b2d7f3871c5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/976d60326fbd</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[kube-api-server]]></category>
            <dc:creator><![CDATA[Jinha Jeong]]></dc:creator>
            <pubDate>Sat, 22 Jun 2024 05:41:53 GMT</pubDate>
            <atom:updated>2024-06-22T05:41:53.465Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*ko0_6f6ar7fFDmJvfZQU3Q.png" /></figure><p>Ever notices that kubernetes service is located in the default namespace and wondered about its purpose?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OMI5-AQR7qwsin2E4ji2IA.png" /></figure><p>If you look into this service, you will get a hint about the use of this service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xpTPuAFkb2xGLWh4kmYkrQ.png" /></figure><p>First, there is no Selector specified. This means that there are no backend pods associated with this service to respond to requests. Second, the type of this service is ClusterIP, which indicates that its purpose is for internal use only. ClusterIP creates a Virtual IP (VIP) that can only be accessed by workloads within the cluster. In this example, the Virtual IP is 10.43.0.1. Lastly, as you can guess from the label component=apiserver, its target port is 6443, which is the default port of the kube-apiserver. <strong>In general, this kubernetes service is used for workloads within the cluster wanting to access the API server.</strong></p><p>But how does this work? You can find the answer in the <a href="https://kubernetes.io/docs/concepts/architecture/control-plane-node-communication/">official Kubernetes documentation</a>.</p><blockquote><a href="https://kubernetes.io/docs/concepts/workloads/pods/">Pods</a> that wish to connect to the API server can do so securely by leveraging a service account so that Kubernetes will automatically inject the public root certificate and a valid bearer token into the pod when it is instantiated. The kubernetes service (in default namespace) is configured with a virtual IP address that is redirected (via <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/">kube-proxy</a>) to the HTTPS endpoint on the API server.</blockquote><p><strong>Yes, we need to leverage a service account to connect to the API server.</strong></p><p>Whenever a pod is instantiated, Kubernetes mounts the Cluster CA certificate and Service account token to the path “/var/run/secrets/kubernetes.io/serviceaccount”. The Cluster CA certificate (ca.crt) is used to verify the SSL certificate of the Kubernetes API server, ensuring secure communication. The Service account token (token) is used for authenticating requests to the API server, allowing the pod to securely interact with the Kubernetes API server. You can check those files by running these two commands:</p><pre>kubectl run -I --tty --rm debug --image=alpine --restart=Never -- sh<br>cd /var/run/secrets/kubernetes.io/serviceaccount &amp;&amp; ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lhy5ACZbyewhs_ATEyOk9A.png" /></figure><p>You can now try to make a connection with the API server, but you need to download curl first:</p><pre>apk add --no-cache curl</pre><p>We know that the Kubernetes service lives in the default namespace, so we can use its domain name to access this service. By running the command below, we can try to make a connection to the API server:</p><pre>curl --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \<br>     -H &quot;Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)&quot; \<br>     https://kubernetes.default.svc.cluster.local</pre><p>Or you can use the environment variables automatically configured by Kubernetes for pods to access the API server. Kubernetes sets the KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT environment variables in each pod, which can be used to construct the URL for accessing the API server. Here’s an example of how you can use these variables with curl to make a request to the API server:</p><pre>curl --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \<br>     -H &quot;Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)&quot; \<br>     https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT</pre><p>However, it returns a Failure Status as shown in the screenshot below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_Ks_2zBGFH7eyZKAQhFUg.png" /></figure><p>This means that the service account this pod is using does not have the authority to access the given API path. <a href="https://kubernetes.io/docs/tasks/run-application/access-api-from-pod/">By default, pods use the service account associated with their namespace</a>, and if not specified in the pod’s manifest, pods will use the default service account in their namespace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GYuFLZY3DS_9IkLH1ZR-AQ.png" /></figure><p>This default service account has no specific authorities given, so for you to use this service account, you need to grant some authorities to it using Role and RoleBinding.</p><pre>apiVersion: rbac.authorization.k8s.io/v1<br>kind: Role<br>metadata:<br>  namespace: default<br>  name: service-reader<br>rules:<br>- apiGroups: [&quot;&quot;]<br>  resources: [&quot;services&quot;]<br>  verbs: [&quot;get&quot;, &quot;list&quot;]</pre><pre>apiVersion: rbac.authorization.k8s.io/v1<br>kind: RoleBinding<br>metadata:<br>  name: service-read-access<br>  namespace: default<br>subjects:<br>- kind: ServiceAccount<br>  name: default<br>  namespace: default<br>roleRef:<br>  kind: Role<br>  name: service-reader<br>  apiGroup: rbac.authorization.k8s.io</pre><pre>kubectl apply -f role.yaml<br>kubectl apply -f rolebinding.yaml</pre><p>Since I only gave permission to get and list services within the default namespace, the curl requests should be changed as shown below:</p><p>Using DNS name:</p><pre>curl --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \<br>     -H &quot;Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)&quot; \<br>     https://kubernetes.default.svc.cluster.local/api/v1/namespaces/default/services</pre><p>Using environment variables:</p><pre>curl --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \<br>     -H &quot;Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)&quot; \<br>     https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT/api/v1/namespaces/default/services</pre><p>Now, let’s see the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dtr7C8Dp2Uq_TfKuxkmv3Q.png" /></figure><p>Now, you can read the services in the default namespace from within your pod. If you try to get other resource information, such as Pods, you will encounter the Forbidden Status again, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VXg2qJGDnDsmmNNBD-200Q.png" /></figure><p>Understanding the use of Kubernetes service in default namespace and how to access the Kubernetes API server from within your pod is crucial for managing and interacting with your Kubernetes cluster efficiently. By leveraging service accounts and configuring appropriate roles and bindings, you can control the access and permissions of your pods, ensuring secure and organized operations within your cluster.</p><p>By following these steps, you can effectively manage and interact with the Kubernetes API server from within your pods, enhancing the security and efficiency of your cluster operations. I hope you find this article useful :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=976d60326fbd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Overlay Filesystem and Its Use in Container Runtime]]></title>
            <link>https://medium.com/@jinha4ever/overlay-filesystem-and-its-use-in-container-runtime-693eba88a2a7?source=rss-b2d7f3871c5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/693eba88a2a7</guid>
            <category><![CDATA[overlay]]></category>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[filesystem]]></category>
            <dc:creator><![CDATA[Jinha Jeong]]></dc:creator>
            <pubDate>Sun, 03 Mar 2024 12:58:06 GMT</pubDate>
            <atom:updated>2024-03-05T12:25:12.912Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q5kifhs2gAoJYGtEC3IHzw.png" /></figure><p>Have you ever wondered how Container Runtime manages container images to make the best use of disk storage and offers individual file system view for each container? Today, I would like to discuss the overlay filesystem and how container runtimes leverage this type of filesystem. After reading this article, you will get a better understanding of the overlay filesystem’s role in container technology, its benefits for efficient storage utilization, and how it enables runtime isolation and independence among containers.</p><p>I created a Kubernetes cluster using GKE, and it automatically assigns an external IP to each node, allowing you to log in to the node via this IP. On your local terminal, you can generate a public and private SSH key pair for gaining access to the node by using the command ssh-keygen. Then, enter the following command:</p><pre>gcloud compute ssh {YOUR_NODE_NAME} --zone {YOUR_ZONE}</pre><p>This command will automatically register your public SSH key with Google Cloud Platform (GCP) if it hasn’t been manually registered already. Therefore, when you visit GCP and navigate to the SSH Keys menu under Compute Engine, you’ll find the newly registered SSH public key listed there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UEavz7okactA_AcF3f3bYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V4LsXA2tPsxQho24hGcrUQ.png" /></figure><p>Now that you are logged onto the node, execute sudo -i<strong> </strong>to switch to the root user, then run df -h to display the disk space usage in a human-readable format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zix0E2qes-Mli0TUH_9Uuw.png" /></figure><p>You can see many mount points associated with the overlay filesystem. To take a closer look at these types of filesystems and their mount points, run df -h | grep overlay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wesIb5D7iQnTK86xmpvN0A.png" /></figure><p>As you can see, these mount points have much in common. They start with /run/containerd/io.containerd.runtime.v2.task/k8s.io, and there&#39;s some hash value going on after that, before finishing with /rootfs. What’s the purpose of these directories and why do they utilize an overlay filesystem? And further more, what exactly is an overlay filesystem?</p><p>When a container is running on a Kubernetes cluster, it leverages an overlay filesystem to have its own filesystem. The overlay filesystem is a technique that merges various directories into a single view with a designated mount point. An overlay filesystem requires three directories to be set up for creation: ‘lowerdir’, ‘upperdir’, and ‘workdir’. By examining the command below, you can gain a better understanding of what an overlay filesystem is:</p><pre>sudo mount -t overlay overlay -o lowerdir=/path/to/lower,upperdir=/path/to/upper,workdir=/tmp/overlay /mnt/merged</pre><p>The lowerdir is designated for read-only access and serves as the base layer. The upperdir is the directory where all modifications are stored, acting as the writable layer. The workdir is used for processing changes before they are finalized in the upperdir thus it is not included in the unified view. By accessing the filesystem through the /mnt/merged mount point, you obtain a unified view that seamlessly integrates the lowerdir and upperdir. In a containerization environment, containers should run in separate environments; they have their own file systems. They utilize overlay filesystems to manage changes made while the container is running and can also share the same base image among other containers, thereby saving a significant amount of disk space.</p><p>Let’s take one example from the captured picture from above</p><pre> /run/containerd/io.containerd.runtime.v2.task/k8s.io/501b7d056e57935a17e664733c527d6db1b20c6fda186dc1d6bfa4bcac0ee08a/rootfs</pre><p>To get straight to the conclusion, the mount point specified is the root filesystem of a container, identified by the container ID ‘501b7d056e57935a17e664733c527d6db1b20c6fda186dc1d6bfa4bcac0ee08a’, and it is managed by containerd within a Kubernetes (k8s.io) environment. If you navigate to the directory /run/containerd/io.containerd.runtime.v2.task/k8s.io/501b7d056e57935a17e664733c527d6db1b20c6fda186dc1d6bfa4bcac0ee08a, you will be able to see essential files and subdirectories for managing a container within a Kubernetes environment, managed by containerd. Crucially, the rootfs directory exists as well, serving as the container&#39;s root filesystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Gn_dG1pbt-eXhdGY4H_3g.png" /></figure><p>If you want to understand why rootfs is the root directory of the container, you can run the following command:</p><pre>cat config.json | grep root</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*gwmvk9XmVvJMEWbsBMIWxw.png" /></figure><p>This will show you that the root path is configured as rootfs. Therefore, /run/containerd/io.containerd.runtime.v2.task/k8s.io/501b7d056e57935a17e664733c527d6db1b20c6fda186dc1d6bfa4bcac0ee08a/rootfs serves as the mount point, offering a unified view of the readable and writable directories of the root file system for this specific container. Listing this directory will reveal the files and directories contained within.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*VoOsgq3W5WNPSwwi5McvdQ.png" /></figure><p>Now, I would like to show you the composition of this container’s root filesystem. You can see that by running the following command:</p><pre>cat /proc/mounts | grep 501b7d056e57935a17e664733c527d6db1b20c6fda186dc1d6bfa4bcac0ee08a</pre><pre># cat /proc/mounts | grep 501b7d056e57935a17e664733c527d6db1b20c6fda186dc1d6bfa4bcac0ee08a<br>overlay <br>/run/containerd/io.containerd.runtime.v2.task/k8s.io/501b7d056e57935a17e664733c527d6db1b20c6fda186dc1d6bfa4bcac0ee08a/rootfs <br>overlay <br>rw,relatime,<br>lowerdir=<br> /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/5/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/4/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/2/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs,<br>upperdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/77/fs,<br>workdir=/var/lib/containerd/io.containerd.snapshotter.</pre><p>By definition, the mount point /run/containerd/io.containerd.runtime.v2.task/k8s.io/501b7d056e57935a17e664733c527d6db1b20c6fda186dc1d6bfa4bcac0ee08a/rootfs offers a unified view of the following directories:</p><ul><li>/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/5/fs</li><li>/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/4/fs</li><li>/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3/fs</li><li>/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/2/fs</li><li>/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs</li><li>/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/77/fs</li></ul><p>This list illustrates the layered structure that composes the root filesystem of this specific container. The image below shows the result of listing all the directories mentioned above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UqYybKYe7YX1OBzycDldFA.png" /></figure><p>Below is the unified view once again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*VoOsgq3W5WNPSwwi5McvdQ.png" /></figure><p>So, by separating directories into writable and readable categories, each container can have its own unique filesystem. While they are running, containers can write whatever they want in their configured upper directory, and it won’t affect the lower directories, which are read-only. Thus, containers with the same image would share the same lower directories but will have their own upper directory so that they can be independent of one another.</p><p>Below are the configurations of two containers employing an overlay filesystem, both using the same image.</p><pre># cat /proc/mounts | grep 993d6f7f729c0087eb74aca5c78fa5a95507abf151171ed0c06e0e3430a2060c<br>overlay <br>/run/containerd/io.containerd.runtime.v2.task/k8s.io/993d6f7f729c0087eb74aca5c78fa5a95507abf151171ed0c06e0e3430a2060c/rootfs <br>overlay rw,relatime,<br>lowerdir=<br> /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/316/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/315/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/314/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/313/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/312/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/311/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/310/fs,<br>upperdir=<br>/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/318/fs,<br>workdir=<br>/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/318/work 0 0</pre><pre># cat /proc/mounts | grep c78356253c004b7e23b205145930e23e0d9b6c32c1d587fb4d60b60343dafc64<br>overlay /run/containerd/io.containerd.runtime.v2.task/k8s.io/c78356253c004b7e23b205145930e23e0d9b6c32c1d587fb4d60b60343dafc64/rootfs <br>overlay rw,relatime,<br>lowerdir=<br> /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/316/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/315/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/314/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/313/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/312/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/311/fs<br>:/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/310/fs,<br>upperdir=<br>/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/317/fs,<br>workdir=<br>/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/317/work 0 0</pre><p>As I explained earlier, containers created from the same image indeed share the same read-only layers (lower directories, from snapshot 310 to 316) in an overlay filesystem. This allows for efficient use of disk space and resources, while also ensuring runtime isolation and independence among containers.</p><p>In conclusion, I hope this discussion has provided you with a better understanding of the importance and functionality of the overlay filesystem within container runtime environments. Since it’s been a bit lengthy, I’ll say goodbye for now!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=693eba88a2a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step-by-Step Guide: Installing Datadog agent in Kubernetes using Operator]]></title>
            <link>https://medium.com/@jinha4ever/step-by-step-guide-installing-datadog-agent-in-kubernetes-using-operator-0f264ed4becb?source=rss-b2d7f3871c5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f264ed4becb</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[datadog]]></category>
            <dc:creator><![CDATA[Jinha Jeong]]></dc:creator>
            <pubDate>Wed, 24 Jan 2024 16:30:43 GMT</pubDate>
            <atom:updated>2024-01-24T16:39:51.645Z</atom:updated>
            <content:encoded><![CDATA[<p>I am a Java backend developer at WhaTap Labs, a SaaS Monitoring company based in Seoul, South Korea. I’m currently working in the Kubernetes monitoring product group, which means there are times when I actively search for other monitoring tools to see how they perform and what I can learn from using their products. Of course, while exploring various monitoring solutions, Datadog is one tool I definitely do not skip.</p><p>Last time I checked, there were two ways to install Datadog Agent on Kubernetes— using Helm or a DaemonSet. But now, Datadog has introduced Datadog Operator to make adding new features easier in the future and to ensure the maintenance of the desired state of the Datadog Agent deployed in a Kubernetes Cluster. For more details and access to the source code, you can visit the Datadog Operator’s GitHub repository here: <a href="https://github.com/DataDog/datadog-operator">https://github.com/DataDog/datadog-operator</a></p><p>Then, what exactly is an ‘Operator’? Simply put, an Operator is a user-defined Kubernetes controller. It leverages Custom Resource Definitions (CRDs) to introduce new resources into Kubernetes and provides the logic to manage these resources. For instance, just as a ReplicaSet acts as a controller to maintain a specific number of pods, an Operator serves as a specialized controller for Custom Resources (CRs). It plays a crucial role in automating complex operational tasks for specific applications.</p><p>Now, let’s install Datadog Agent in Kubernetes using Operator. First, if you haven’t installed Datadog helm repository in your cluster already, you can use the command below to install the repository.</p><pre>helm repo add datadog https://helm.datadoghq.com</pre><p>Then you can use this command to install Datadog Operator in your cluster.</p><pre>helm install datadog-operator datadog/datadog-operator</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f7rrhJVmHUaeztEyBG2ZgA.png" /></figure><p>After successfully installing Datadog Operator, you should create Secret object that includes your api-key and app-key. You can get your api-key directly in your Datadog Kubernetes installation page, but app-key is not created automatically so you should create app key first before you create Secret for your Datadog Agent.</p><p>You can go here to create Application Keys: <a href="https://us5.datadoghq.com/organization-settings/application-keys">https://&lt;YOUR_DATADOG_SITE&gt;/organization-settings/application-keys</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GOszWQOpLvf8JGIH21XcAQ.png" /></figure><p>Click the ‘New Key’ button on the right side of Application Keys page, and name the Application Key as you prefer, and then use the value under the KEY column to create a Secret Object.</p><pre>kubectl create secret generic datadog-secret --from-literal api-key=&lt;DATADOG_API_KEY&gt; --from-literal app-key=&lt;DATADOG_APP_KEY&gt;</pre><p>Then, define a DatadogAgent Object, which is a Custom Resource Definition(CRD).</p><pre>kind: DatadogAgent<br>apiVersion: datadoghq.com/v2alpha1<br>metadata:<br>  name: datadog<br>spec:<br>  global:<br>    site: us5.datadoghq.com<br>    credentials:<br>      apiSecret:<br>        secretName: datadog-secret<br>        keyName: api-key<br>      appSecret:<br>        secretName: datadog-secret<br>        keyName: app-key<br>  override:<br>    clusterAgent:<br>      image:<br>        name: gcr.io/datadoghq/cluster-agent:latest<br>    nodeAgent:<br>      image:<br>        name: gcr.io/datadoghq/agent:latest</pre><p>You need to change spec.global.site to your specific Datadog site. For example, Mine is set to US5.</p><p>Then you can add credentials using the Secret we created earlier. Since we have created only one Secret, the secretName will be the same for both apiSecret and appSecret, but the keyName will differ depending on the credential.</p><p>After filling in all the necessary informations to create a DatadogAgent Object, we all know what we are going to do next. Yes, the famous command:</p><pre>kubectl apply -f datadog-agent.yaml </pre><p>You can do</p><pre>kubectl get datadogagent</pre><p>to monitor the agent installation process. After a while, you can confirm on your Datadog Kubernetes installation page that the installation has been successfully completed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*On2dCcv1AV4Cmq1yiZfKDg.png" /></figure><p>Finally, when you go to Infrastructure then click Kubernetes, you can now monitor your Kubernetes cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8oKb0ET612q6Gkevk0neXA.png" /></figure><p>Trying to install agents of other monitoring solution has helped me become a more customer-friendly developer, which is what I aspire to be. I’m less accustomed to this process compared to WhaTap Kubernetes Agent installation. Therefore, being relatively new to this experience, I can better emphasize with WhaTap customer’s difficulties when they try to install the agents. When I’m stuck in the process of installing agents, I refer to various official documentation to get hints, which helps me understand the importance of well-written documentation and user guides.</p><p>Experiencing other monitoring solutions and installing their agents is not just for broadening my technical knowledge. It plays a crucial role in my journey to become a more customer-friendly developer, which is my goal. By using products from other companies, I gain insights from different user experiences, which allows me to come up with ideas to enhance the usability and efficiency of our product. By viewing our product from the customer’s perspective and understanding their needs and challenges, I can contribute to making our product more user-friendly. Therefore, I believe that experiencing competitors’ products is an essential part of developing better products. This approach will continuously improve the WhaTap Kubernetes monitoring system I am developing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f264ed4becb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>