<?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 David Layardi on Medium]]></title>
        <description><![CDATA[Stories by David Layardi on Medium]]></description>
        <link>https://medium.com/@davidlayardi?source=rss-bec0709da3c9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ozZ_Ttv6xWdFlOswG5vpWg.jpeg</url>
            <title>Stories by David Layardi on Medium</title>
            <link>https://medium.com/@davidlayardi?source=rss-bec0709da3c9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 14:41:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@davidlayardi/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[Accessing GCP Secret Manager from GKE Cluster using Murmur]]></title>
            <link>https://davidlayardi.medium.com/accessing-gcp-secret-manager-from-gke-cluster-using-murmur-34c679f25333?source=rss-bec0709da3c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/34c679f25333</guid>
            <category><![CDATA[gcp-secret-manager]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[David Layardi]]></dc:creator>
            <pubDate>Tue, 16 Apr 2024 07:26:55 GMT</pubDate>
            <atom:updated>2024-04-16T07:26:55.258Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cX-ccqpbW1b4q-aESh436Q.png" /><figcaption>Made using Canva</figcaption></figure><p>Secret manager implementation is one of the industry&#39;s best practices that currently are ubiquitous standards. The awareness of secret manager implementation can be seen from a survey that <a href="https://www.akeyless.io/blog/the-essential-guide-to-secrets-management/">AKeyLess</a> did that showed some interesting highlights:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zs-3r2zZH216N_li" /><figcaption>Quoted from <a href="https://www.akeyless.io/blog/the-essential-guide-to-secrets-management/">AKeyLess</a> article</figcaption></figure><p>As an overview, most security experts place the secrets manager implementation on the top priority list since it gains significant impact in terms of risk mitigation.</p><blockquote>Suppose you want more information about the definition of Secret Manager and its standard, it can be easily surfed from the internet since many articles can explain it more comprehensively.</blockquote><p>I will focus on talking about one of the Secret Manager’s products offered by GCP since it’s easy to try and implement for organizations/companies that use GCP as their Cloud Foundation.</p><p>There are other alternatives to Secret Manager products like Vault by Hashicorp, Azure Key Vault, AWS Secrets Manager, and many more so, you can use it based on your conditions/use cases/team size/other considerations.</p><p>You can consider GCP Secret Manager for several considerations:</p><ol><li>Secret Manager platform that has capabilities to log all of the changes and audit for user activities related to secrets key</li><li>Secret Manager platform that is ready to use and natively integrated into GCP</li><li>Secret Manager platform that can expose secret value end-to-end without exposing the value to humans (unless from the Secret Manager platform itself)</li></ol><p>For implementing GCP Secret Manager, a common way to consume the secret is by using <a href="https://cloud.google.com/secret-manager/docs/authentication">Client Libraries</a> (integrate GCP Secret Manager to code itself), and setting up <a href="https://cloud.google.com/docs/authentication/application-default-credentials">Application Default Credentials</a> so our applications or services can access the secret values.</p><p>Going more specific for applications that run on top of GKE, the approach for integrating GKE to this Secret Manager might be the same, or you can do some experimentation for new integration made by GCP (when this article was created, the <a href="https://cloud.google.com/secret-manager/docs/secret-manager-managed-csi-component">Secret Manager add-on</a> was currently on Preview phase).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qg87oOTPFWZDlQ15Sx9d8Q.png" /><figcaption>The secret Manager add-on is currently in the Preview phase</figcaption></figure><p>But by default, If you’re deploying your application/service on top of GKE, we can use workload identity to access the GCP Secret Manager.</p><p>It can be more challenging if you don’t want or aren’t able to modify the source code. For example, You’re deploying 3rd third-party service inside your cluster and aren’t able to modify the code as part of a business agreement. But don’t worry, we can still utilize the GCP Secret Manager. Let me introduce your Murmur!</p><h3>Say hello to Murmur</h3><p>Murmur has developed using a plug-and-play paradigm to make the application able to get the secret value from the Secret Manager Provider without modifying our application code. We can get secret value from GCP Secret Manager by including murmur Binary with our application. Let’s use a simple diagram to understand what Murmur does:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MyTk38QcUS7ygUpOKI1Siw.png" /><figcaption>an overview of murmur workflow. source: self-drawn</figcaption></figure><p>The workflow starts when we run murmur to run our application as a subprocess using the following command:</p><pre>./murmur run -- [command to run our apps]</pre><p>At first, murmur will start checking all of the ENV values. if ENV contains the <a href="https://github.com/busser/murmur?tab=readme-ov-file#gcpsm-provider-gcp-secret-manager">pattern</a> to get value from the secret manager, it will start the auth process to the GCP Secret manager using <a href="https://github.com/busser/murmur/blob/v0.6.1/internal/murmur/providers/gcpsm/client.go">the Secret Manager library</a>.</p><p>Here’s one example of getting a secret from the GCP Secret manager:</p><pre>gcpsm:my-project-name/my_secret_sauce</pre><p>this pattern will ask murmur to get <strong><em>my_secret_sauce</em></strong> from project <strong><em>my-project-name</em></strong>, by default it will fetch the latest version. You can specify which secret version you want to fetch as well:</p><pre>gcpsm:my-project-name/my_secret_sauce#2</pre><p>Murmur will use a service account attached to the instance (Instance Attached Service Account) or deployment (Workload Identity). If the service account has permission to access the secret, replace the ENV value with the fetched result.</p><p>The replacement process only happens at the subprocess level, so if someone can check the ENV value inside the instance or container, they can’t see the fetch results.</p><h4>Integrating Murmur with Kubernetes Deployment</h4><p>There are two approaches to integrating our application with Murmur:</p><ol><li>Add murmur during the <strong>Dockerbuild</strong> process</li><li>Copy murmur binary to Kubernetes Pod using <strong>initContainer</strong></li></ol><p>Before we dive into both approaches, we need to make sure we already have the following resources:</p><ol><li>Create a GCP Service Account for Accessing the GCP Secret Manager and have a workload identity user role</li><li>Create a Kubernetes Service Account that bonded with the GCP Service Account</li></ol><p>for example, you have a GCP SA called secret-accessor:</p><pre>gcloud iam service-accounts create secret-accessor \<br>    --project=my-awesome-project</pre><p>then let’s give it access to our secret sauce</p><pre>gcloud secrets add-iam-policy-binding YOUR_SECRET_SAUCE \<br>    --member=&quot;serviceAccount:serviceAccount:secret-accessor@my-awesome-project.iam.gserviceaccount.com&quot; \<br>    --role=&quot;roles/secretmanager.secretAccessor&quot;</pre><p>after that, add let’s allow GCP SA as workload identity user</p><pre>gcloud iam service-accounts add-iam-policy-binding secret-accessor@my-awesome-project.iam.gserviceaccount.com \<br>    --role roles/iam.workloadIdentityUser \<br>    --member &quot;serviceAccount:my-awesome-project.svc.id.goog[your-kube-namespace/kube-sa-name]&quot;</pre><p>After we finish the setup process for the Service Account, let’s go into both approaches:</p><p>The 1st approach can be done by adding the following line in your <strong>Dockerbuild</strong> file:</p><pre>COPY --from=ghcr.io/busser/murmur:latest /murmur /bin/murmur</pre><p>Then, change the point to start the application using a murmur command.</p><pre># from this:<br>ENTRYPOINT [&quot;/bin/run-my-app&quot;]</pre><pre># to this:<br>ENTRYPOINT [&quot;/bin/murmur&quot;, &quot;run&quot;, &quot;--&quot;, &quot;/bin/run-my-app&quot;]</pre><p>The 2nd approach is done by utilizing the <strong>initContainer</strong> workflow, so we can copy the Murmur binary using a sharing folder. Let’s take an example:</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: my-app<br>  namespace: my-app <br>spec:<br>  serviceAccountName: secret-accessor<br>  initContainers:<br>    - name: copy-murmur<br>      image: ghcr.io/busser/murmur:latest<br>      command: [&quot;cp&quot;, &quot;/murmur&quot;, &quot;/shared/murmur&quot;]<br>      volumeMounts:<br>        - name: shared<br>          mountPath: /shared<br>  containers:<br>    - name: my-app<br>      image: my-app:latest<br>      command: [&quot;/shared/murmur&quot;, &quot;run&quot;, &quot;--&quot;, &quot;/bin/run-my-app&quot;]<br>      volumeMounts:<br>        - name: shared<br>          mountPath: /shared<br>  volumes:<br>    - name: shared<br>      emptyDir: {}</pre><p>Let’s use the 2nd approach which has more deployment flexibility. Here’s a visualization about the murmur deployment strategy on Kubernetes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LZ-nzybUoLyLRAByz8wHdA.png" /><figcaption>Murmur workflow on Kubernetes Platform. source: self-drawn</figcaption></figure><p>When the pod is created using the deployment manifest or pod manifest, it will run the container with a shared volume called “<strong>shared</strong>”. if you’re looking at the init container command it will copy the binary of murmur inside the container to the shared volume.</p><pre>command: [&quot;cp&quot;, &quot;/murmur&quot;, &quot;/shared/murmur&quot;]</pre><p>Next, this shared volume will be attached to our application container, and then we will override the container init command with the murmur run command:</p><pre>command: [&quot;/shared/murmur&quot;, &quot;run&quot;, &quot;--&quot;, &quot;/bin/run-my-app&quot;]</pre><p>Example of log output if murmur can discover the GCP Secret Manager value:</p><pre>[murmur] overloading YOUR_SECRET_SAUCE</pre><p>One of the common problems during this setup is you’re not setting up the service account’s permission correctly. You will see this kind of log in your application container:</p><pre>* YOUR_SECRET_SAUCE: could not resolve reference: failed to access secret &quot;YOUR_SECRET_SAUCE&quot; version &quot;latest&quot;: rpc error: code = Unauthenticated desc = transport: per-RPC creds failed due to error: compute: Received 403 `Unable to generate access token; IAM returned 403 Forbidden: Permission &#39;iam.serviceAccounts.getAccessToken&#39; denied on resource (or it may not exist).<br>This error could be caused by a missing IAM policy binding on the target IAM service account.<br>For more information, refer to the Workload Identity documentation:<br>https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity#authenticating_to</pre><p>This can be because you do not attach the GCP SA access to the secret manager or the GCP SA can’t authenticate as a workload identity user. Another potential issue can be because you’re not set the GKE Cluster run using Workload Identity Federation for GKE</p><h4>Conclusion</h4><p>Murmur is helping to integrate our application with GCP Secret Manager without changing our code, you can consider this approach because Murmur offers more than 1 Secret provider compatibility:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ued4SRgyWvfXTPc8EmgZ1w.png" /><figcaption>Current murmur compatibility at version v6.0.1</figcaption></figure><p>So when it comes to multi-cloud deployment or cloud migration, the secret manager transition can be easier since the compatibility layer is handled by murmur. But, if you’re considering using GCP for the rest of your life, it seems like Murmur is too overkill for that.</p><p>The main reason isn’t just that, another reason it doesn’t expose the secret value inside the container if you’re trying to execute the murmur command there. So no one knows the secret value unless they have access to the GCP Secret Manager dashboard.</p><p>You can consider GCP Secret Manager since it has a monthly free tier for doing some trials/POC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3bjaImGlMIA_B8JGICdeow.png" /></figure><p>But again, use a secret manager provider based on the goal you want to achieve.</p><blockquote>Choose Wisely 🤫</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*O06N1EyGFhykAuQX.jpg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34c679f25333" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Cloudflare Zero Trust & VS Code Tunnels Reducing My Back Pain]]></title>
            <link>https://davidlayardi.medium.com/how-cloudflare-trust-zero-vs-code-tunnels-reducing-my-back-pain-67c38c506a28?source=rss-bec0709da3c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/67c38c506a28</guid>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[vscode]]></category>
            <dc:creator><![CDATA[David Layardi]]></dc:creator>
            <pubDate>Sat, 15 Apr 2023 08:11:37 GMT</pubDate>
            <atom:updated>2023-04-15T08:45:24.357Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2B8i2v_xaLpNW_ZiWgljmQ.png" /></figure><p>Sounds silly, but it’s real. Cloudflare Zero Trust (CZT) &amp; VS Code Remote Tunnels being part of helps me reduce my back pain. In this article, let me share my journey to reduce backpack weight for work to less than 3kg and set up my work tools into a “simple data center” accessible via CZT.</p><blockquote>This article isn’t sponsored by Cloudflare or Microsoft (If you want, we can talk about that :D ), so this article only contains a bunch of experience using VS Code Remote Tunnels &amp; CZT in the $0 / Free tier without any <strong>“sugar coating”</strong> inside.</blockquote><h3>What’s The Problem?</h3><p>My motivation comes from a simple problem statement, How do I make my work device available remotely and can be accessed with a lighter device (in terms of weight)?</p><p>It was triggered when I started trying to work outside my room/house. I quite often carry office equipment and several other supporting devices. Generally, I bring the same equipment between working at home and outside by bringing a Mechanical Keyboard and a Portable Screen as my secondary display.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n3B1aC1Cp5V1cVe6g2bg8g.jpeg" /><figcaption>IIRC total weight of these setup is more than 5kg</figcaption></figure><p>After several weeks I often feel pain in my back. I realized I more often bend my back because the backpack load hit almost 10kg (sometimes more).</p><p>After that, the policy where I worked started to make me work almost every day in the office, so I finally decided to reduce some of my belongings. It reduces my backpack weight quite a bit, but since the office laptop remains quite large, it becomes quite heavy. A little illustration, the laptop size is a MacBook with a 16&quot; screen in 2.3kg weight, excluding the charger itself and any other my belongings.</p><h3>Solutions</h3><p>Thanks to my colleagues gave me inspiration about making my laptop accessible remotely when we discussed private tunneling and bringing lighter equipment.</p><blockquote>(Feel free to jump to the Implementation section in case you want straightforwardly see the technical steps)</blockquote><p>Let’s break down some of my requirements:</p><ul><li>Access the terminal &amp; other CLI tools that installed on my laptop</li><li>Access IDE for editing manifest/configuration</li><li>Access Web UI that forwarded from CLI tools to the machine’s local port</li><li>Run some tools in my local docker and access it from web UI/CLI</li><li>Browser (essential, of course!)</li></ul><p>At starting, I’m using VSCode Remote Tunnels to do all of these. I’ll explain how I did it in another section below. VS Code is accessible via a browser. It means you can use almost any OS platform to work if you have at least a browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F5RZZdNspwBvE2-YNFmluw.jpeg" /><figcaption>11&quot; Galaxy Tab S8 vs 14&quot; MacBook Pro</figcaption></figure><p>For the device I bring to the office, I’m using an Android tablet (Samsung Galaxy Tab S8). It can be another device like any other lightweight laptop, but I found several sweet spots in why this device is best for me compared to other devices like iPad/Windows Tablet/Windows Laptop:</p><ul><li>Compared to a phone, I can work on a tablet’s screen itself without relying on another external monitor since the size is quite enough</li><li>Compared to most Microsoft Windows devices in the market, the Android tablet can have a more reliable battery (it can last for more than 6 hours for intense usage on my testing).</li><li>Android devices can be charged using most of the power banks available in the market. It’s a benefit since I don’t have to bring a specific DC plug charger to charge my device. Just bring a power bank, and I got extra power juice for work.</li><li>Compared to iPad, I can install termux for terminal emulation. It can be handy in case I can’t access my laptop termux can help to do some CLI tasks.</li><li>Oh, an additional benefit when using an ARM-based device, you will not hear any fan noise :D</li></ul><blockquote>Btw, this article is created on my Tablet. So yeah, probably it’s time for the era of “compact working device”?</blockquote><h3>2nd Problem Happened</h3><p>Only relying on the VS Code Tunnels have some drawbacks that you need to consider. If this issue isn’t a problem, you can just go with VS Code Tunnels. There are some issues I face after several days on this setup:</p><ul><li>For some reason, Copying/Pasting to VS Code CLI can be troublesome based on some browsers. I am using the Chrome browser. I can’t do a copy operation on the terminal in VS Code. I tried using another browser like Samsung browser. I can do copy operation but can’t do a paste operation.</li><li>VS Code has a cloud port forwarding feature. But for some cases, I often get “<em>Rate Limit Exceeded</em>” when using this feature.</li><li>Sometimes, when typing commands inside the VS Code terminal feel a little bit <em>laggy</em>. Probably because of the tunnel bandwidth.</li></ul><p>And this is where’s the Cloudflare Zero Trust (CZT) implementation benefit kicks in, where we can utilize SSH client apps in Android/iOS to get a more powerful terminal interface (it solves the copy &amp; paste issues in the browser previously). I’m using termux as my SSH client. It works pretty well to handle my task without any noticeable latency.</p><p>Let me draw an image to give the overview how each part of our tools can be accessed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w8bmvgHkO7GJ5-trHFNDBQ.jpeg" /><figcaption>Network Flow</figcaption></figure><h3>Implementation</h3><p>This section is the purpose of why I wrote this. I’ll show you how I did it so you can start your implementation soon. Let’s start!</p><h4>Setup VS Code Remote Tunnel</h4><p>Please refer to this article if you find some command in this article isn’t working (<a href="https://code.visualstudio.com/docs/remote/tunnels">https://code.visualstudio.com/docs/remote/tunnels</a>). Of course, you have to install the VS code on your laptop. There’re two approaches available:</p><p>1. Enable tunnel via Desktop UI<br>Log in to your GitHub/Microsoft account since it will be the auth method for connecting to the tunnel. Go to the account menu on the left down, then click the “Turn on Remote Tunnel Access” choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*c26YAAFkLJf_NcvUItLdvA.png" /><figcaption>Image quoted from <a href="https://code.visualstudio.com/docs/remote/tunnels">Visual Studio blog</a></figcaption></figure><p>Congratulations, the tunnel is established! Visit <a href="https://vscode.dev/">https://vscode.dev</a> to start working remotely from your browser and log in using your account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ca3BT-N8wgPaDQSH7_0ITQ.png" /><figcaption>Image quoted from <a href="https://code.visualstudio.com/docs/remote/tunnels">Visual Studio blog</a></figcaption></figure><p>Go to the “Remote Explorer” section, select tunnel based on your computer name, and choose the arrow symbol to establish a tunnel connection. If the icon on the bottom left changes from “&gt;&lt;” to the computer name, you already work from the remote environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*NiZIC-VQcytYXHl68RaNQw.png" /><figcaption>Image quoted from <a href="https://code.visualstudio.com/docs/remote/tunnels">Visual Studio blog</a></figcaption></figure><p>Things you need to consider is you have to keep the Desktop UI open. If it is closed/terminated, your tunnel will be closed. But when you reopen the Desktop UI, the tunnel will be re-established automatically.</p><p>2. Enable tunnel via CLI<br>I recommend this way since it creates background service and can be without UI. If you also set up CZT after this, you can use your SSH client to execute this approach. Similar to 1st approach, install VS Code on your device. Execute the following command in your terminal:</p><pre>code tunnel service install</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*To0IAGzniCkpN2EhdhLC7g.png" /></figure><p>Go to the “Remote Explorer” section, and select tunnel based on your computer name. If you see your computer name is there, you just successfully set up the tunnel!</p><blockquote>Tip: If you’re facing an error like Workspace does not exist, create a new workspace file in your working folder by using your IDE. Another trick (tested on the MacOS platform) is to add <strong>“/”</strong> to the end of the VS Code URL.</blockquote><blockquote>Let me know if you’re facing different behavior below</blockquote><h4>Setup Cloudflare Zero Trust (CZT)</h4><p>As mentioned above, we face some limitations and considerations when we rely on VS Code Tunnels. The issue is when it comes to how we do some copy/paste operations in VS Code IDE Terminal. Alternatively, we can use another SSH client to do some terminal operations. But this solution comes with a challenge, how to connect our computer when we’re outside our private network? Let me introduce you to Cloudflare Zero Trust (CZT), which can provide secure solutions starting from $0! I’ll refer to your computer as a <strong>server</strong> here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-BjyGVUPHxYAmpGFrYb0eA.png" /><figcaption>Quoted from<a href="https://blog.cloudflare.com/building-many-private-virtual-networks-through-cloudflare-zero-trust/"> Cloudflare Blog</a></figcaption></figure><p>The simplest way to look at the CZT architecture is similar to a VPN connection. But CZT here helps manage the connectivity by acting as a virtual bridge between your device and the server devices. After it is connected, we can directly access our devices by calling their IP address from our local SSH client. Simple, right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*xX4DQU7KjB6c3aYqb_wYDA.png" /><figcaption>Quoted from<a href="https://blog.cloudflare.com/building-many-private-virtual-networks-through-cloudflare-zero-trust/"> Cloudflare Blog</a></figcaption></figure><p>Without further explanation, let’s start! We need to create a Cloudflare account (of course). Go to the Cloudflare dashboard, choose the Zero Trust section, and it will redirect to the CZT section.</p><p>We will set up a tunnel for our device, go to left navigation, click Access, and then click Tunnels. Click “Create a Tunnel” and fill in the Tunnel name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AA86uP3M2mY4baNCPwZihw.jpeg" /><figcaption>Fill the tunnel name</figcaption></figure><p>You’ll redirect to the installation process. In this section, Cloudflare provides guidelines on how to install “cloudflared” based on the operating system of the server device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2EKX51GGiES0iVxZmmyuCw.jpeg" /><figcaption>cloudflared installation</figcaption></figure><p>Choose the operating system and architecture based on the device that will act as the server. CZT will check the connector or “cloudflared” status periodically. After the connection is recognized, click next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZBO5CZ0KgXQaD7ANUbzrdA.jpeg" /></figure><p>In the route tunnel section, there are two sections. Let’s set up the “Private networks” first. We will make our local server IP address accessible in the CZT private network. Now, let’s find your server IP address. Reserve static IP in your local network if possible, so you don’t need to readjust our IP addresses again later. Click “Add a private network” and input the CIDR of your IP address. If only exposing the server IP, you can use the “/32” range. For example, if we want to access “192.168.0.2”, the CIDR range will be<strong> “</strong>192.168.0.2/32&quot;.</p><p>If you want to access all your local IPs, you can use the CIDR range of your local IP. Example, “192.168.0.0/24”. Finally, click the “Save private network” button.</p><p>Now the server must be accessible from CZT, but we haven’t finished yet. CZT following RFC1918 (<a href="https://developers.cloudflare.com/cloudflare-one/tutorials/warp-to-tunnel/">https://developers.cloudflare.com/cloudflare-one/tutorials/warp-to-tunnel/</a>) will make them bypass the private IP so it won’t get a tunnel. We will use the Split Tunnel feature to make our private IP reachable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*axrrDeOav5eFW8rN6ZMwrA.jpeg" /></figure><p>Let’s configure Split Tunnel, open the sidebar menu, and choose Settings. Since the split tunnel configuration is on the WARP client level, choose WARP Client. You will see the “Default” profile name in the Profile settings section (if not, you can create a new one).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jFRDlvjH5B88atrKXL4tQQ.jpeg" /></figure><p>Click the “Default” profile name, and click the Configure button. Scroll down until you find the Split Tunnels section, and ensure the “Include IPs and domains” choice is selected. Then click the Manage button.</p><blockquote>Note: If you think these steps can be improved, let me know in the response section!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*MiISHuFt1g0RfiSg1bmckA.jpeg" /><figcaption>Fill your IP CIDR range</figcaption></figure><p>Fill out the form on the left. For the selector, choose the IP Address choice. For value, input your CIDR that we filled on the tunnel setup. Don’t forget to click the “Save destination” button.</p><p>Next, we will be setting our device enrollment permissions. In this section I’m going to use email as our auth method, now head to the sidebar menu, and choose Settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oz4PVF0tP_4CHpxxTmU9wg.jpeg" /></figure><p>Click the “Manage” button on the device enrollment permissions section, and click the “Add a rule” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*thesQ0NxfO5iXgO4Tx65Sw.jpeg" /></figure><p>Fill in the rule name as you like, and choose “Allow” in the “Rule action” dropdown list. In the selector dropdown list, “Emails” and fill in the Value with your email account. Finally, click “Save”.</p><p>Looks good! Now we will set up our connectivity from our client device. We need the WARP client to do this. Skip the Download steps if you have to use the “1.1.1.1” service before. The client app used for CZT is the same. Heading to the sidebar menu, choose Settings, and select the Downloads menu. Choose based on your client’s device operating system.</p><p>Now we need to find out what is our organization’s name. If you did not remember what is your org name, head back to the CZT web dashboard. Go to Settings in the sidebar menu, and choose General. You will find your org name in the Team domain section.</p><p>After WARP is installed, open the application. Click the upper right hamburger menu, and click the “Account” menu. Choose the “Login to Cloudflare Zero Trust”. If there’s a popup that describes what is CTZ, just click next, and click Accept. Enter the organization name and click Next. It will redirect you to the Cloudflare Access login page. Fill in your email and choose “Send me a code”. You will get a code in your email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*p6jwqJmH5V1WcUTbFwz-Ng.jpeg" /><figcaption>WARP client interface after auth into CZT</figcaption></figure><p>If you success authenticate to CZT, now your WARP splash screen logo will be changed to Zero Trust. Switch the toggle and tried to access your server from your different network.</p><p>Additionally, you can expose SSH/Web UI from your local to the public using a domain name. We gonna set up a secure way to expose this publicly. Let’s say we have a local app and we want to expose it publicly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wDionVHgrleLwzADdhwkZw.png" /><figcaption>Quoted from <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/">CZT Tunnel Documentation</a></figcaption></figure><p>Cloudflare can allow connection from the public can accessing to our local app. With CZT also, we can create an additional authentication layer so we can expose publicly our local app, for example, if you want to expose some monitoring tools but only accessible to you or your teammates.</p><p>In this scenario, we will create an access group to make a list of allowed people. By creating an access group, we will reduce some redundancy steps for other public apps later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lyr7K9ipisTG2rRZPDej-g.jpeg" /><figcaption>Create Access Group in CZT</figcaption></figure><p>Open the left panel menu &gt;&gt; “Access” &gt;&gt; “Access Groups”. Click Add a Group button and fill in the “Group name” Tick the checkbox “Set as default group”, in the “Group configuration”, and choose Emails in the selector section. Fill in your email in the value section, and then click the Save button.</p><p>Now we are going to set up our application to be accessible from the server to the public, let’s head back to the left panel menu &gt;&gt; Access &gt;&gt; Tunnels. Click your tunnel name and click the “Configure” button. Click the “Public hostname” button, and the required values.</p><p>Make sure you already have the domain registered in Cloudflare. Fill the subdomain with something, and choose the domain dropdown with your domain. In the Service Type, choose “<strong>HTTP</strong>”, and fill in the URL values with your local IP and local port. For example, if you running a web app on the “6767” port. fill the url with “127.0.0.1:6767”. Now click the “Save hostname” button.</p><p>After exposing our app, you can just let it as is if you want to make the app publicly expose. If you want to add more authentication layers, head back to the left panel menu &gt;&gt; Acess &gt;&gt; Applications. Click “Add an application” and choose “Self-hosted”. <br>Then fill in the required values, and make sure the application domain name is the same as before. For “Session Duration” you can change based on your preferences.</p><p>Click next, and fill in the policy name. Make sure to tick the access group that we’ve created before. Click next again, and let the rest config remain the same. Finally, click the “Add application” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J-mcjaJ9xJKpasyCxSbMcw.jpeg" /><figcaption>Authentication page when accessing the application endpoint</figcaption></figure><p>Now if you access the application url, you will see some OTP auth pages.</p><h3>Closing</h3><p>CZT gave some legit things to consider, but yeah lets fingers crossed they can always provide this free tier. If you ask if is there any alternative for CTZ, yes we have another option. You can take a look at Tailsacle. It will be another story if we want to discuss it.</p><p>See you on the another article~</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67c38c506a28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automate Export From Jenkins API Job List to Google Sheets Using Google Apps Script]]></title>
            <link>https://medium.com/geekculture/automate-export-from-jenkins-api-job-list-to-google-sheets-using-google-apps-script-2eef44008bdc?source=rss-bec0709da3c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/2eef44008bdc</guid>
            <category><![CDATA[google-apps-script]]></category>
            <category><![CDATA[jenkins-api]]></category>
            <category><![CDATA[export-data]]></category>
            <category><![CDATA[google-sheets]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[David Layardi]]></dc:creator>
            <pubDate>Fri, 20 Aug 2021 04:02:43 GMT</pubDate>
            <atom:updated>2021-08-20T04:02:43.185Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JvwHkkkVuhpGYndPILMRnQ.gif" /></figure><p>One day… you were asked to create a list of data that comes from an API to a <em>common platform</em> appearance that will be easier for the managerial level to understand, such as Google Sheets. One of the real cases I experienced was exporting a list of Jenkins Job to Google Sheets for managerial view auditing purposes. Thanks to Google for providing easy integration with the various additional features that we can use. One of which we will discuss this time is Google Apps Script.</p><h3>Easy fetching data using Google Apps Script</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*67D0I2aNSfSq9V0XjmxBkA.png" /><figcaption>accessing Google Apps Script in Google Sheets</figcaption></figure><p>To access the Google Apps Script in Google Sheets just go to the upper menu section, click <strong>Tools</strong>, then <strong>Script Editor</strong>. This tool is easy to adapt if you’re familiar with Javascript syntax and has pretty good features that can provide some additional features in the use of various Google products. Here’s some feature quoted from <a href="https://developers.google.com/apps-script/overview">Google Developer page</a></p><ul><li>Add <a href="https://developers.google.com/apps-script/guides/menus">custom menus</a>, <a href="https://developers.google.com/apps-script/guides/dialogs">dialogs, and sidebars</a> to Google Docs, Sheets, and Forms.</li><li>Write <a href="https://developers.google.com/apps-script/execution_custom_functions">custom functions</a> and <a href="https://developers.google.com/apps-script/guides/sheets/macros">macros</a> for Google Sheets.</li><li>Publish <a href="https://developers.google.com/apps-script/execution_web_apps">web apps</a> — either standalone or embedded in Google Sites.</li><li>Interact with other <a href="https://developers.google.com/apps-script/guides/services">Google services</a>, including AdSense, Analytics, Calendar, Drive, Gmail, and Maps.</li><li>Build <a href="https://developers.google.com/workspace/add-ons/overview">add-ons</a> to extend Google Docs, Sheets, Slides, and Forms, and publish them to the Add-on store.</li><li>Convert an Android app into an <a href="https://developers.google.com/workspace/add-ons/mobile">Android add-on</a> so that it can exchange data with a user’s Google Doc or Sheet on a mobile device.</li><li>Streamline Google Chat workflows by building a <a href="https://developers.google.com/hangouts/chat/quickstart/apps-script-bot">chatbot</a>.</li></ul><p>One of the advantages that I quite feel great about is that we don’t need to create an interface for simple user input. For example, if you just want to user input Sheets name, you can easily add the following line when editing the .gs script:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1af490103e460dbb2890abf713f39b1d/href">https://medium.com/media/1af490103e460dbb2890abf713f39b1d/href</a></iframe><p>and here’s the result :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*BcKLRsvWC47qEdDho82Brg.png" /><figcaption>Custom input box dialog in Google Sheets</figcaption></figure><h3>Things to consider using Google Apps script (Case Study)</h3><p>One of the things you might consider to learning this tool is the ease of retrieval of the data you need if the work you are doing is going to be repetitive. Maybe we will often use the <strong><em>copy &amp; paste</em></strong> method to process data, if we can reduce the steps that are done manually, this can prevent human errors later. For to be more descriptive, let’s look at the example case below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W2G0YG_84aEFwyOUfVr9rQ.jpeg" /><figcaption>Workflow example when processing data using the manual data conversion method</figcaption></figure><p>using the Google Apps script we can directly enter data from the API into our Sheets without using a manual process. One example of a use case above is when you entering API data manually (for example using <a href="https://www.convertcsv.com/json-to-csv.htm">covertcsv.com</a>), you copying the result back from the API using some converter tools and copy it back to Google Sheets. If you do it just once it might look normal, but if you do it a dozen times (because of updates from the data source/any kind of circumstances) it drives us to a less productive task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HMRWD2AI09MKszCdA4oYCw.jpeg" /><figcaption>Workflow processing data using Google Apps Script</figcaption></figure><p>By reducing the use of external tools and being carried out automatically, allow us to reduce the risk of human errors that may occur and also shorten the time we do to process / reprocessing data. In addition, creating a script can help us anticipate when the data source / API source that we use has some changes or additional structure because we can simply adjust the mapping of the data source in the script. The manual process may make this adjustment step longer and easier for human errors to occur</p><h3>Let’s begin!</h3><p>This tutorial can be applied to another API usage, just adjust the data structure you want to use in fetching steps.</p><h4>Fetching data from Jenkins</h4><p>First, we start by understanding the data structure of the Jenkins API, the structure, in this case, is only specific to the Job list section to retrieve information about jobs already run in the Jenkins with their last activity date.</p><p>The Jenkins API structure has many redundant attributes, we can take advantage of this structure to make it easier to retrieve data based on the context we need. I try to pull all the attributes available on the Jenkins API and put them at the end of this article, you can use it as a reference.</p><p>In this case, we will retrieve the Job ID (get from fullNameattribute), displayName, url, and last job run timestamp (get from thetimestampattribute in lastBuild object).</p><h4>Fetching API data from Google Apps Script</h4><p>The Jenkins API requires authentication to work, just adjust to the API authentication method you use if you’re not using the Jenkins API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/188/1*VseyqUYRrog5i7KHO4vAvA.png" /><figcaption>You can find it on the top right corner Jenkins UI</figcaption></figure><p>First, you need to generate a user token. Click <strong>Configure </strong>menu in your Profile menu list section. find <strong>API Token</strong> section, and click <strong>Add new Token </strong>button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*70bELSYnvypHYgVrLnAe0A.png" /></figure><p>Type your token name for describing the token usage, and then click <strong>Generate</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*EZnMxsfYvSiDEyw2tbU_zQ.png" /></figure><p>Copy the shown token or simply just click the copy icon on the right side. Here’s a snippet to retrieve data from API in Google Apps Script</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a5d83ef2e541c6e451ab9dc6bd9df28/href">https://medium.com/media/4a5d83ef2e541c6e451ab9dc6bd9df28/href</a></iframe><p>let auth_header = Utilities.base64Encode(user_name+ ‘:’ + user_token);</p><p>In this section, you can see Jenkins authentication uses a combination of username and user token encoded with the base64 scheme. Then sent it with the request header. Google Apps Script already provides the base64 encoder by calling the Utiliteslibrary. Next one, this part is the most important</p><p>let response = UrlFetchApp.fetch(url_endpoint,{ ‘method’: ‘GET’, ‘muteHttpExceptions’ : true, ‘headers’ : {‘Authorization’ : ‘Basic ‘+ auth_header} });</p><p>Google Apps Script has a library UrlFetchAppthat we can use for fetching data from API. the return type of this request is HTTPResponse object type, so we need to parse it to JSON to make it easier to process. And also, to determine which attribute we want to retrieve from Jenkins, we can specify the attribute in the endpoint URL like the snippet above.</p><h4>Run Apps Script in Google Sheets</h4><p>2 methods can be used to run the script that we have created. The first is to run directly on the Google Apps Script editor menu and Run it on Google Sheets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*T4bcsWaajhEBaufP-uf_kg.png" /><figcaption>Run button in Google Apps Script Editor</figcaption></figure><p>To run in the editor menu, simply press the Run key or press CTRL + R on the keyboard. Make sure you keep the Sheets window open because various Sheets-related libraries won’t work if you close that window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*1T_Axv4tDAvnSnLYP5JHhw.png" /></figure><p>The second one is Creating a Menu to call the function. This method is creating a display menu that appears in the Google Sheets navigation, by making this menu it will be easier for us to access the script without the need to open the menu editor. The following is a function snippet to add a menu to Google Sheets navigation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f3241f434238ebb071fc2b4ed982b322/href">https://medium.com/media/f3241f434238ebb071fc2b4ed982b322/href</a></iframe><p>But a little note that the menu has been created will disappear when the user <strong>refreshes</strong> the window on the sheets, for that we need to re-run the script so that the menu reappears again. We don’t need to open the editor menu again to add this menu because Google provides an import macro function so we can execute this function without opening the editor. Just access the following menu in the Google Sheets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*SCUxm8Mxv5sVCHTo1qGieA.png" /><figcaption>How to run a script without using accessing editor UI</figcaption></figure><p>Then, you can select the function that contains adding menus to Sheets. and then the function name will appear below the Importbutton. Click the function name and the script will be run. Okay, now let’s add data to our Sheets</p><h4>Adding data from API to Sheets</h4><p>The process of adding data to Google Sheets starts with taking the sheet name, then we will add a header to the data and perform a loop to enter the data. The result will be like this</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed4fcc08351c4f8a10ed7ff69f12d913/href">https://medium.com/media/ed4fcc08351c4f8a10ed7ff69f12d913/href</a></iframe><p>In this script, we create an array that is used to hold and formatting the data source and insert the data into Sheets.</p><p>For the header, we can use setFrozenRows so that the header doesn’t move when the data is scrolled down. because A1untilD1 is a header, then the range used to enter data starts from A2.</p><h3>Result</h3><p>Here’s an example result of the full script</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6234353be7bfa08b30db90c6bd61fff4/href">https://medium.com/media/6234353be7bfa08b30db90c6bd61fff4/href</a></iframe><h3>Closing</h3><ul><li>Google Apps Script helps us to fetch data from API easily and refill data again if there are new data added by just running the script.</li><li>The reusable automated action prevents us from human error if we doing it manually.</li><li>We can also improve the script usage experience by adding a UI menu so we don’t need to open the Google Apps Script editor just to run the script</li><li>Google Apps Script Provide build in custom UI for every Google Document apps so we don’t need to build UI if we need simple input from users.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*JZMnri9cgJD34Pda.jpg" /><figcaption>You’re either the one that creates the automation or you’re getting automated (Tom Preston Werner). Images:<a href="https://pepquotes.com/">pepquotes.com</a></figcaption></figure><h3>Jenkins Jobs API Structure Reference</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/49e40b9f89e08d049d32f7b292645d23/href">https://medium.com/media/49e40b9f89e08d049d32f7b292645d23/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2eef44008bdc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/automate-export-from-jenkins-api-job-list-to-google-sheets-using-google-apps-script-2eef44008bdc">Automate Export From Jenkins API Job List to Google Sheets Using Google Apps Script</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy Deploy SonarQube on Kubernetes with YAML configuration]]></title>
            <link>https://medium.com/codex/easy-deploy-sonarqube-on-kubernetes-with-yaml-configuration-27f5adc8de90?source=rss-bec0709da3c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/27f5adc8de90</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[sonar]]></category>
            <category><![CDATA[sonarqube]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[yaml]]></category>
            <dc:creator><![CDATA[David Layardi]]></dc:creator>
            <pubDate>Thu, 22 Jul 2021 09:57:21 GMT</pubDate>
            <atom:updated>2021-07-23T07:15:56.927Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yt2Tl3NZZiPzxwbtEbiWkg.jpeg" /><figcaption>Created using <a href="https://www.canva.com/">Canva</a></figcaption></figure><p>Kubernetes has made easier our deployment and scaling of applications we create. Not only just it, but the tools we used to develop applications can be easier to maintain if they have been deployed on Kubernetes.</p><p>This time we will deploy SonarQube on Kubernetes, these tools mostly use to check our Code Quality score and Code Vulnerabilities. If you directly look at SonarQube&#39;s official documentation about the <a href="https://docs.sonarqube.org/latest/setup/sonarqube-on-kubernetes/">deployment method on Kubernetes</a>, they will direct us to use Helm charts as the deployment method. But maybe this will be a consideration if you have never use the Helm charts before or there are some circumstances in your place that make you unable to use the Helm charts.</p><p>It’s okay because we have an alternative solution to deploy it with YAML configuration, there’s several YAML created in this process and I will explain further in the section below</p><h3>Some requirement</h3><p>The version of Kubernetes I’m using in this article is 1.18.17-gke.1901. If you’re using a version newer or older than this, just modify the configuration to match the version you are using now. I’ll make the YAML configuration as general as possible.</p><p>For computation resource requirements, we need at least as many resources as the system requirements <a href="https://docs.sonarqube.org/latest/requirements/requirements/">written on the website</a>. The SonarQube image that I will use is the image that comes from the <a href="https://hub.docker.com/_/sonarqube">official docker</a> and the <a href="https://hub.docker.com/r/bitnami/postgresql">PostgreSQL image from Bitnami </a>for the databases. Just adjust the image parameter and drive mounting location if you use another source of the image.</p><blockquote>You can get all snippets in <a href="https://github.com/doctor500/sonarqube-on-kubernetes">this repository</a>, just check it out.</blockquote><h3>Deploying Databases (PostgreSQL)</h3><p>Create configuration of Persistent Volume Claim and Deployment for PostgreSQL. You can skip this step if you’re using an external service like a fully managed database service, etc.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/56bd0394c8edb3c0b1dcfc89ef0ff9f2/href">https://medium.com/media/56bd0394c8edb3c0b1dcfc89ef0ff9f2/href</a></iframe><p>And this is my YAML configuration for PostgreSQL deployment, don’t forget to set up the PostgreSQL credential in the config map section, we’ll use it later on Sonar YAML.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39dd53e4e3cafd6c94f041bc1d5176a7/href">https://medium.com/media/39dd53e4e3cafd6c94f041bc1d5176a7/href</a></iframe><h3>Deploying Application</h3><p>Let’s start with create a configuration of Persistent Volume Claim used by SonarQube</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa5e1c32711474f4b1805b29b6262530/href">https://medium.com/media/aa5e1c32711474f4b1805b29b6262530/href</a></iframe><p>Now we’ll create a Deployment configuration for SonarQube. At this stage, we need to do a little trick in configuring SonarQube. One of the configurations needed to run <a href="https://docs.sonarqube.org/latest/requirements/requirements/">SonarQube in a Linux environment</a> is to increase the maximum amount of virtual memory by changing the value of max_map_countto 524288. If SonarQube is deployed on a VM, this might not be a big deal as we can change it permanently. But in Kubernetes, it takes a bit of an extra step so this configuration can continue to be applied when pods are created. We can do this by adding a step initContainer in the Deployment template. In this step, we’ll deploy busybox and run the max_map_countconfiguration. I use the value 262144as the minimum required virtual memory to running SonarQube.</p><p>The configuration that we need also to pay attention to is the database connection settings. Official SonarQube image parameter using JDBC URL format to set the database connection. You can see the example below</p><pre>“jdbc:postgresql://postgres:5432/sonar_db”</pre><ul><li>postgresvalue is based on PostgreSQL container name in Kubernetes environment, we can access the container by using the container name. Change it to your defined container name.</li><li>sonar_db value is based on POSTGRESQL_DATABASEwhat we define on the Postgres config map</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/42a2fb848ac4aa5343cfb1820ef507ad/href">https://medium.com/media/42a2fb848ac4aa5343cfb1820ef507ad/href</a></iframe><h3>Deploying Ingress</h3><p>After the deployment configuration is applied, create an ingress to expose the service. In this step, I will use ingress with the Nginx controller. Deploying an Nginx controller is not too difficult because you can follow the steps<a href="https://kubernetes.github.io/ingress-nginx/deploy/"> in their documentation</a>. Let’s start by adding a secret for the SSL certificates, you’ll need the SSL key and the SLL certificate.</p><blockquote>This step is not required if you want to expose the SonarQube in HTTP protocol. You can just remove the tlssection in the Ingress YAML and apply it.</blockquote><pre>kubectl create secret tls my-fancy-certs — key ssl.key — cert ssl.crt -n sonar</pre><p>after the secret is created, configure ingress with the Nginx class</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a1d50e074c8ab09a1153c0693355fc8b/href">https://medium.com/media/a1d50e074c8ab09a1153c0693355fc8b/href</a></iframe><p>And, here we go! just do some quick setup and your sonar is ready to use.</p><h3>Closing</h3><p>by installing SonarQube in the Kubernetes environment, we can easily maintain the version we are using. Simply by changing the image tag on the Deployment specs, and <strong><em>voila*</em></strong>!</p><blockquote>*Please make sure you read the <a href="https://docs.sonarqube.org/latest/setup/upgrade-notes/">Release Upgrade Notes</a> to prevent something unwanted</blockquote><p>Another thigs to notes is if you’re application compiled in Java 15 environment, make sure you using Jacoco at least version 0.8.7(If you using Jacoco for code coverage reporting), because the Jacoco with version below 0.8.7 doesn’t support Java 15 yet.</p><p>In Gradle, you can add the following line to define the Jacoco version :</p><pre>jacoco {</pre><pre>    toolVersion = “0.8.7”</pre><pre>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27f5adc8de90" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/easy-deploy-sonarqube-on-kubernetes-with-yaml-configuration-27f5adc8de90">Easy Deploy SonarQube on Kubernetes with YAML configuration</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pengalaman 3+1 (Enrichment Program) bersama Bapak Ali Gunawan, S.Kom., M.M. @ Binus University]]></title>
            <link>https://davidlayardi.medium.com/pengalaman-3-1-enrichment-program-bersama-bapak-ali-gunawan-s-kom-m-m-binus-university-dbaf528ec258?source=rss-bec0709da3c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbaf528ec258</guid>
            <category><![CDATA[binus-university]]></category>
            <category><![CDATA[internship-experience]]></category>
            <category><![CDATA[binus]]></category>
            <dc:creator><![CDATA[David Layardi]]></dc:creator>
            <pubDate>Sat, 13 Jun 2020 13:43:35 GMT</pubDate>
            <atom:updated>2020-06-13T13:43:35.182Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*7gPTt2cA4vQGVxhC.jpg" /><figcaption>Source: <a href="http://threeplusone.binuscareer.com/">Binus Career</a></figcaption></figure><blockquote>Tulisan ini saya dedikasikan sebagai bentuk apresiasi kepada Pak Ali Gunawan, S.Kom., M.M. yang telah membimbing saya selama menjalankan program enrichment (yang biasa dikenal sebagai program 3+1) sehingga saya dapat bekerja dengan performa yang terbaik dan dapat mempelajari berbagai ilmu yang aplikatif dari tempat saya bekerja. Terima kasih Pak Ali ! 😊</blockquote><blockquote>Salam,</blockquote><blockquote>David Layardi<br>2001593095</blockquote><p>nb: Program ini saya ambil pada semester 6 dan 7, yaitu pada bulan februari 2019 hingga februari 2020. Sehingga mungkin bisa saja terjadi beberapa perubahan program yang tersedia pada waktu kedepan.</p><h3>Sekilas mengenai <em>enrichment program</em></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/0*v02JaBoogo1G04cQ.jpg" /><figcaption>Source: <a href="https://student.binus.ac.id/31-enrichment-program/">Binus Student site</a></figcaption></figure><p>Dalam sudut pandang saya sebagai mahasiswa Binus, program enrichment adalah salah satu metode yang diterapkan binus untuk memberikan pembekalan pengalaman di luar kampus pada berbagai praktek dimulai dari magang, pengabdian sosial (<em>community development</em>), penelitian, studi ke universitas luar negeri (<em>study abroad</em>), hingga merilis usaha sendiri (<em>entrepreneurship</em>). Istilah 3+1 berasal dari program belajar yang ada di Binus yang terdiri dari 3 tahun kuliah + 1 tahun enrichment program.</p><p>Pada waktu akan memilih program, saat itu saya sudah bekerja di Divisi IT Bina Nusantara. Sehingga saya berkonsultasi dengan pihak jurusan, saya direkomendasikan untuk mengambil program magang agar bisa ‘sekalian’ dengan pekerjaan yang telah saya jalankan semenjak semester 2 itu. Setelah proses pemilihan program selesai, akhirnya saya mendapatkan pembimbing Bapak Ali Gunawan, S.Kom., M.M. yang diumumkan sewaktu <em>briefing </em>program 3+1. Saat itu beliau tidak hadir karena berhalangan, maka kami berkenalan melalui ‘<em>Whatsapp</em>’ dan membuat jadwal untuk berkonsultasi.</p><h3>Bimbingan bersama Pak Ali</h3><h4>TL;DR (Summary)</h4><p>Pak Ali mengajarkan saya mengenai pengembangan karakter yang membantu saya dalam dunia kerja seperti kedisplinan, adaptif, hingga ketegasan akan prinsip yang telah dipegang. Pak Ali tetap mengusahakan untuk selalu hadir pada waktu konsultasi diberbagai rutinitasnya yang padat karena beliau juga memiliki jadwal mengajar di kelas dan bekerja di suatu perusahaan <em>sotware house </em>dimana pekerjaan yang dia ambil membutuhkan alokasi waktu yang tidak sedikit untuk bertemu dengan berbagai rekan <em>client</em>.</p><p>Pak Ali sendiri juga selalu memberikan berbagai inputan pada setiap masalah yang kami diskusikan bersama, serta proaktif membantu untuk setiap hal yang saya tanyakan ataupun permasalahkan. Saya merasa senang karena mendapatkan bimbingan yang baik dari Pak Ali dan membuat saya dapat berkembang lebih baik dari diri saya yang sebelumnya 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbaf528ec258" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>