<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Kunal Parikh</title>
    <description>The latest articles on Forem by Kunal Parikh (@techthumb).</description>
    <link>https://forem.com/techthumb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F188076%2F126cf648-d4ab-4093-90ae-c10de4a22808.jpeg</url>
      <title>Forem: Kunal Parikh</title>
      <link>https://forem.com/techthumb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/techthumb"/>
    <language>en</language>
    <item>
      <title>Docker on macOS via minikube with support for corporate proxies with custom certificate authority</title>
      <dc:creator>Kunal Parikh</dc:creator>
      <pubDate>Thu, 23 Sep 2021 17:25:30 +0000</pubDate>
      <link>https://forem.com/techthumb/docker-on-macos-via-minikube-with-support-for-corporate-proxies-with-custom-certificate-authority-1dgk</link>
      <guid>https://forem.com/techthumb/docker-on-macos-via-minikube-with-support-for-corporate-proxies-with-custom-certificate-authority-1dgk</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Set proxy&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;HTTPS_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'host:port'&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;https_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HTTPS_PROXY&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;HTTP_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HTTPS_PROXY&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;http_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HTTPS_PROXY&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;NO_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'localhost,127.0.0.1,10.96.0.0/12,192.168.64.112/32,192.168.39.0/24,192.168.49.0/24,192.168.99.0/24'&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;no_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$NO_PROXY&lt;/span&gt;

&lt;span class="c"&gt;# Add Custom Root CAs to&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.minikube/certs
&lt;span class="c"&gt;# cp /path/to/custom.pem ~/.minikube/certs&lt;/span&gt;

&lt;span class="c"&gt;# Install&lt;/span&gt;
brew &lt;span class="nb"&gt;install &lt;/span&gt;hyperkit
brew &lt;span class="nb"&gt;install &lt;/span&gt;minikube

&lt;span class="c"&gt;# Start minikube&lt;/span&gt;
minikube start &lt;span class="nt"&gt;--embed-certs&lt;/span&gt; &lt;span class="nt"&gt;--container-runtime&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;docker &lt;span class="nt"&gt;--driver&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;hyperkit &lt;span class="nt"&gt;--docker-env&lt;/span&gt; &lt;span class="nv"&gt;HTTP_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HTTP_PROXY&lt;/span&gt; &lt;span class="nt"&gt;--docker-env&lt;/span&gt; &lt;span class="nv"&gt;HTTPS_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HTTPS_PROXY&lt;/span&gt; &lt;span class="nt"&gt;--docker-env&lt;/span&gt; &lt;span class="nv"&gt;NO_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$NO_PROXY&lt;/span&gt; &lt;span class="nt"&gt;--docker-env&lt;/span&gt; &lt;span class="nv"&gt;http_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$http_proxy&lt;/span&gt; &lt;span class="nt"&gt;--docker-env&lt;/span&gt; &lt;span class="nv"&gt;https_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$https_proxy&lt;/span&gt; &lt;span class="nt"&gt;--docker-env&lt;/span&gt; &lt;span class="nv"&gt;no_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$no_proxy&lt;/span&gt;

&lt;span class="c"&gt;# Add minikube's ip to the no proxy list&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;NO_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;minikube ip&lt;span class="sb"&gt;`&lt;/span&gt;,&lt;span class="nv"&gt;$NO_PROXY&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;no_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$NO_PROXY&lt;/span&gt;

&lt;span class="c"&gt;# Set up Docker&lt;/span&gt;
curl &lt;span class="nt"&gt;-L&lt;/span&gt; https://download.docker.com/mac/static/stable/x86_64/docker-20.10.8.tgz | &lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xz&lt;/span&gt;  &lt;span class="nt"&gt;--strip-components&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="nt"&gt;-C&lt;/span&gt; /usr/local/bin docker/docker
&lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;minikube &lt;span class="nt"&gt;-p&lt;/span&gt; minikube docker-env&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>docker</category>
      <category>minikube</category>
    </item>
    <item>
      <title>Set Bazel BUILD_EMBED_LABEL to git commit SHA with state of uncommitted changes</title>
      <dc:creator>Kunal Parikh</dc:creator>
      <pubDate>Wed, 08 Jan 2020 16:43:52 +0000</pubDate>
      <link>https://forem.com/techthumb/set-bazel-buildembedlabel-to-git-commit-sha-with-state-of-uncommitted-changes-55ja</link>
      <guid>https://forem.com/techthumb/set-bazel-buildembedlabel-to-git-commit-sha-with-state-of-uncommitted-changes-55ja</guid>
      <description>&lt;p&gt;The following git command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;git describe &lt;span class="nt"&gt;--always&lt;/span&gt; &lt;span class="nt"&gt;--dirty&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;produces this output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a3da1ee # when working tree does not have uncommitted changed
a3da1ee-dirty # when working tree has uncommitted changed
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Next, we plug the &lt;code&gt;git describe&lt;/code&gt; command into &lt;code&gt;--workspace_status_command&lt;/code&gt; flag&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;bazel build target &lt;span class="nt"&gt;--workspace_status_command&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'echo "BUILD_EMBED_LABEL `git describe --always --dirty`"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;For convenience of not having to repeat the flag, I've placed the following in &lt;code&gt;.bazelrc&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;build --workspace_status_command='echo "BUILD_EMBED_LABEL `git describe --always --dirty`"'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>bazel</category>
    </item>
    <item>
      <title>Helm2 in GKE</title>
      <dc:creator>Kunal Parikh</dc:creator>
      <pubDate>Thu, 14 Nov 2019 16:40:16 +0000</pubDate>
      <link>https://forem.com/techthumb/helm2-in-gke-3ld</link>
      <guid>https://forem.com/techthumb/helm2-in-gke-3ld</guid>
      <description>&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl create serviceaccount &lt;span class="nt"&gt;-n&lt;/span&gt; kube-system tiller

&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl create clusterrolebinding tiller-cluster-admin &lt;span class="nt"&gt;--clusterrole&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;cluster-admin &lt;span class="nt"&gt;--serviceaccount&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;kube-system:tiller

&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl &lt;span class="nt"&gt;--namespace&lt;/span&gt; kube-system patch deploy tiller-deploy &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s1"&gt;'{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>gke</category>
      <category>helm2</category>
    </item>
    <item>
      <title>gcloud SSLHandshakeError</title>
      <dc:creator>Kunal Parikh</dc:creator>
      <pubDate>Wed, 13 Nov 2019 21:05:52 +0000</pubDate>
      <link>https://forem.com/techthumb/gcloud-sslhandshakeerror-4bdg</link>
      <guid>https://forem.com/techthumb/gcloud-sslhandshakeerror-4bdg</guid>
      <description>&lt;p&gt;If you find yourself behind a corporate proxy and need to disable SSL validation for &lt;code&gt;google-cloud-sdk&lt;/code&gt;, here's the setting for it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;gcloud config &lt;span class="nb"&gt;set &lt;/span&gt;auth/disable_ssl_validation True
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Ideally, you should set the path to custom trusted certs using this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;gcloud config &lt;span class="nb"&gt;set &lt;/span&gt;core/custom_ca_certs_file /path/to/certs.pem
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>googlecloudsdk</category>
      <category>gcp</category>
      <category>gcloud</category>
    </item>
  </channel>
</rss>
