<?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 apit on Medium]]></title>
        <description><![CDATA[Stories by apit on Medium]]></description>
        <link>https://medium.com/@fizdoonk?source=rss-2214cb0d8f50------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by apit on Medium</title>
            <link>https://medium.com/@fizdoonk?source=rss-2214cb0d8f50------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 18:47:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fizdoonk/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[K3D and blocked DNS]]></title>
            <link>https://fizdoonk.medium.com/k3d-and-blocked-dns-5331638c98d0?source=rss-2214cb0d8f50------2</link>
            <guid isPermaLink="false">https://medium.com/p/5331638c98d0</guid>
            <category><![CDATA[k3d]]></category>
            <dc:creator><![CDATA[apit]]></dc:creator>
            <pubDate>Wed, 12 Jan 2022 03:23:50 GMT</pubDate>
            <atom:updated>2022-01-12T03:26:31.302Z</atom:updated>
            <content:encoded><![CDATA[<p>k3d uses CoreDNS and its default configuration is to forward DNS query outside the cluster to the container where the node run. The default configuration for Docker (as CRI of k3d) is also to forward to host (my computer).</p><p>I don’t know why in the case of my new internet provider, Biznet, pods failed to resolve DNS queries even though when using Orbit it succeeds. I tried to manually edit /etc/resolve.conf of the container where the CoreDNS pod runs with no luck though it should’ve been.</p><p>I am a lazy person and networking is not my strong suit so if somehow the query was ‘blocked’ and the easiest way to circumvent DNS blocking is using DoT (DNS over TLS) and CoreDNS support that, why not use it anyway?</p><p>This is how to do it:</p><p>First, make sure we can use DoT</p><pre>&gt; sudo apt-get install -y knot-dnsutils<br> &amp;&amp; kdig -d <a href="http://twitter.com/1">@1</a>.1.1.1 +tls-ca +tls-host=cloudflare-dns.com <a href="http://www.bpk.go.id/">www.bpk.go.i</a>d</pre><pre>;; SNIP<br>;; ANSWER SECTION:<br><a href="http://www.bpk.go.id/">www.bpk.go.id</a>.       13456 IN A 103.11.179.32</pre><p>If yes, continue with</p><pre>&gt; kubectl edit cm -n kube-system coredns</pre><p>Replace the line withforward’s directive with the following lines</p><pre># forward . /etc/resolv.conf<br>forward . tls://1.1.1.1 tls://1.0.0.1 {<br>   tls_servername cloudflare-dns.com<br>   health_check 5s<br>}</pre><p>CoreDNS should pick up that, if not just restart it:</p><pre>&gt; kubectl -n kube-system rollout restart deployment coredns</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5331638c98d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scaling Shiny App using Traefik and Docker Swarm]]></title>
            <link>https://fizdoonk.medium.com/scaling-shiny-app-using-traefik-and-docker-swarm-5cb6fc620228?source=rss-2214cb0d8f50------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cb6fc620228</guid>
            <category><![CDATA[traefik]]></category>
            <category><![CDATA[shiny]]></category>
            <dc:creator><![CDATA[apit]]></dc:creator>
            <pubDate>Wed, 17 Mar 2021 04:15:10 GMT</pubDate>
            <atom:updated>2021-03-18T09:19:26.150Z</atom:updated>
            <content:encoded><![CDATA[<p>Scaling <a href="https://shiny.rstudio.com/">Shiny app</a> is quite tricky primarily because of the nature of single-threaded R. There are several options that we know of:</p><ul><li><a href="https://shinyproxy.io/">Shinyproxy</a>; spawning/terminating app container for each user, can be run on Docker and Kubernetes mode. As our app is quite big and took quite some time to initialize, this is not our first option.</li><li><a href="https://rstudio.com/products/rstudio/#rstudio-server">Shiny Server Pro</a>; run multiple processes. I don’t know how they achieve this, perhaps some sort of the following approach. Too expensive.</li><li>Instead of spawning for each new user, why not create several pre-warmed app containers, load-balanced users, and scale it if there are too many of them.</li></ul><p>This is a quick note on the third approach, using Traefik and docker as its provider.</p><p><a href="https://traefik.io/">Traefik</a> is an Edge-Router, sits at the edge of network, proxying requests to among others web apps behind it. In its parlance, our app is ‘service’. Traefik has the ability to auto-discover routes and configuration from the service itself instead of defining it statically on the Traefik side. When we scale up/down service, it will configured its routing definition automatically. Traefik has several ‘providers’ that can supply that information beside static configuration, eg. Docker and Kubernetes Ingress.</p><p>After the initial Swarm setup (basically install docker and enable swarm mode on several servers and join them together; we’ll call them nodes), we create Docker Compose configuration (must be version &gt; 3.0) like below.</p><pre># swarm.yaml<br>version: &#39;3.2&#39;<br>services:<br>  traefik: <br>    image: traefik:v2.4.7<br>    deploy:<br>      placement:<br>        constraints:<br>          - node.role == manager<br>      labels:<br>        - &quot;traefik.http.services.traefik.loadbalancer.server.port=3840&quot;<br>    command:<br>      - &quot;--api.insecure=true&quot;<br>      - &quot;--providers.docker=true&quot;<br>      - &quot;--providers.docker.swarmMode=true&quot;<br>    ports:<br>      - published: 3840<br>        target: 80<br>      - published: 8080<br>        target: 8080<br>    volumes: # so traefik can communicate with docker<br>      - /var/run/docker.sock:/var/run/docker.sock:ro</pre><pre>shiny:<br>    image: myrepo/shinyserver:20210316<br>    deploy:<br>      replicas: 10<br>      labels: # stick, easier to trace for error<br>        - &quot;traefik.enable=true&quot;<br>        - &quot;traefik.http.routers.shiny.rule=PathPrefix(`/`)&quot;<br>        - &quot;traefik.http.services.shiny.loadbalancer.server.port=3838&quot;<br>        - &quot;traefik.http.services.shiny.loadbalancer.sticky.cookie=true&quot;<br>        - &quot;traefik.http.services.shiny.loadbalancer.sticky.cookie.name=stickysvr&quot;<br>    volumes:<br>        - /NFS_FOLDER/app/:/app/<br>        - ${PWD}/user_config.yaml:/app/user_config.yaml # secrets</pre><p>That’s it. As you can see, it’s only several labels and scaling parameters on-top of regular Compose. The rest is putting our existing WAF and TLS-termination server in front of this cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iuwGX7cbIKVc40aFDgMY4w.png" /><figcaption>Swarm service resource utilization. We can scale service replica here.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BvJ13kaJIN05kOKWOyKhpg.png" /><figcaption>Traefik dashboard exposed on 8080</figcaption></figure><p>Several works planned to be done afterward:</p><ul><li>Create a ‘sidecar’ app that health check shiny app readiness to serve and monitor if it terminates (eg. throws fatal error). I think in Swarm, it must be on the same container since container is the smallest unit of service. On the other hand, in Kubernetes, it will be a separate container in the same pod.</li><li>Setup observability. We have <a href="https://prometheus.io/">Prometheus</a> and Traefik handily exports metrics for it to consume. Since Shiny is the only service, we will not utilize Traefik tracing logs.</li><li>Script to monitor those metrics and dynamically scale shiny replicas.</li></ul><p>That will have to wait ;-)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cb6fc620228" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Desktop]]></title>
            <link>https://fizdoonk.medium.com/flutter-desktop-e8507490b07c?source=rss-2214cb0d8f50------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8507490b07c</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-desktop]]></category>
            <dc:creator><![CDATA[apit]]></dc:creator>
            <pubDate>Mon, 10 Jun 2019 00:40:41 GMT</pubDate>
            <atom:updated>2019-06-21T11:10:05.412Z</atom:updated>
            <content:encoded><![CDATA[<h3>Exploring Flutter Desktop</h3><p>One of main selling point of Flutter is its ability to write once and deploy to multiple platforms. This is invaluable for certain businesses to be able to switch app from convenience of eg. writing using full-size keyboard on desktop to mobility and practicality of mobile device, all using (hopefully) the exact same set of features *and* interfaces without sacrificing much. This is certainly the case for our business where work times are divided almost equally between office and the field.</p><p>Flutter Desktop along with Flutter Web is not yet available in stable channel, though its technical preview is available for a while. To give you a taste of what Flutter Desktop (and Flutter in general) development is like, this is a walk through of creating a really simple application.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvUcrY-j1Rpg&amp;src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FvUcrY-j1Rpg%3Ffeature%3Doembed&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e7dbf1bb126e19bd5634f7250caed4d/href">https://medium.com/media/0e7dbf1bb126e19bd5634f7250caed4d/href</a></iframe><p>As you can see, Flutter Desktop tooling is not here yet. First, scaffold for desktop app unlike android/ios must be manually copied from Flutter embedded-desktop example project. Secondly, Flutter’s Visual Studio Code extention is not recognizing my desktop as debugging device though it just a matter of, again, a simple copy-and-paste configuration. Finally, we must explicitly override platform target and apply workaround for bug where text not showing up unless we override default font-family by the one from our assets. It may be because default font is not already installed on my desktop.</p><p>[tbc]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8507490b07c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>