<?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 Nandan B N on Medium]]></title>
        <description><![CDATA[Stories by Nandan B N on Medium]]></description>
        <link>https://medium.com/@lucario?source=rss-a648fe324490------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gONA3Lnrf4w5e2hOyf45qQ.png</url>
            <title>Stories by Nandan B N on Medium</title>
            <link>https://medium.com/@lucario?source=rss-a648fe324490------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 00:33:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lucario/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[Istio External OIDC Authentication with OAuth2-Proxy]]></title>
            <link>https://medium.com/@lucario/istio-external-oidc-authentication-with-oauth2-proxy-5de7cd00ef04?source=rss-a648fe324490------2</link>
            <guid isPermaLink="false">https://medium.com/p/5de7cd00ef04</guid>
            <category><![CDATA[istio]]></category>
            <category><![CDATA[service-mesh]]></category>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[oidc]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Nandan B N]]></dc:creator>
            <pubDate>Mon, 09 Aug 2021 17:34:02 GMT</pubDate>
            <atom:updated>2021-08-09T17:37:37.705Z</atom:updated>
            <content:encoded><![CDATA[<h3>Istio OIDC Authentication with OAuth2-Proxy</h3><p>We usually come across various scenarios in every aspect of implementation for which we don’t find a straight solution. One such scenario was implementing external authorization with Istio.</p><p>Since Istio uses Envoy as its proxy which is flexible and highly configurable, it is possible to implement external authorization using custom EnvoyFilter to intercept the requests and forward them to external auth provider with oauth2-proxy <strong>(</strong><a href="https://www.jetstack.io/blog/istio-oidc/"><strong>Reference</strong></a><strong>). </strong>But how can we simplify this now?</p><h3>Let’s see</h3><p>From Istio 1.9, they have implemented extensibility into authorization policy by introducing a <a href="https://istio.io/latest/docs/reference/config/security/authorization-policy/#AuthorizationPolicy-Action">CUSTOM action</a>, which allows you to delegate the access control decision to an external authorization service and makes it super easy to configure external authorization with just a simple custom resource.</p><p>The CUSTOM action with provider configuration allows us to integrate Istio with an external authorization system at gateway/sidecar proxy that implements its custom authorization logic.</p><p>At runtime,</p><ol><li>Based on the AuthorizationPolicy config, the request is intercepted by the proxy (Gateway/Sidecar), and the proxy will send check requests to the external auth service.</li><li>The external auth service will decide whether to allow it or not.</li><li>If allowed, the request will continue and will be enforced by any local authorization defined by ALLOW/DENY action. The respectively configured headers will be forwarded to the actual service from the oauth2-proxy.</li><li>If denied, the request will be rejected immediately and the deny headers will be forwarded back to the requested client.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*8nf6ZE6eRLbJZyesp9wOFQ.png" /></figure><h3>Oauth2-Proxy</h3><p>To forward the requests to the external authentication Oauth2/OIDC provider we must have an interceptor service. <br>We’ll be using oauth2-proxy which will forward the unauthenticated requests to an external provider. Then from the provider’s callback response it retrieves the token, validates it, gets required users’ info, and forwards necessary details to the application service via headers.</p><h3>Setting up Oauth2-Proxy</h3><p>OAuth2-Proxy provides official <a href="https://github.com/oauth2-proxy/manifests">helm charts</a> and we can spin up the oauth2-proxy pod easily by doing helm install.</p><p>Before going to install charts we have to update the values.yaml with external auth providers (such as Google Oauth, AWS Cognito, Github, etc.,) details i.e., client_id, client_secret, issuer_url, etc.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2af27c1a5857b026883c5f3bee7758b2/href">https://medium.com/media/2af27c1a5857b026883c5f3bee7758b2/href</a></iframe><p>Replace with respective values which are mentioned within “&lt; &gt;” as shown in the above example. Once we update with the respective values of Auth provider we want, we are good to install the oauth2-proxy helm chart in our cluster.<br>We can install by using the below commands and verify if oauth2-proxy is running successfully.</p><pre>helm repo add oauth2-proxy <a href="https://oauth2-proxy.github.io/manifests">https://oauth2-proxy.github.io/manifests</a><br>helm install oauth2-proxy oauth2-proxy/oauth2-proxy -f updated_values.yaml</pre><h3>Istio Configuration</h3><h4>External Providers</h4><p>Once we have oauth2-proxy up and running, Istio should forward the desired request to oauth2-proxy which will authorize the request and forward it to the respective service.<br>To do that we should update the external provider’s configuration in the Istio profile under meshConfig as shown below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e176a6cc7b3bd7fd0e458c524378cff6/href">https://medium.com/media/e176a6cc7b3bd7fd0e458c524378cff6/href</a></iframe><p>After updating the Istio profile with the above config, we have to apply the changes. Let’s do it by using below command:</p><pre>istioctl install -f updated-profile.yaml</pre><h4>Authorization Policy</h4><p>Now we have the external provider and oauth2-proxy in place. The last thing is we should have rules defined based on which the requests will be intercepted. To achieve this Istio gives us a custom resource called AuthorizationPolicy using which we can easily define rules.</p><p><strong>Example</strong>: Authorize requests coming from domain “demo.example.com” or requests having path prefix “/api”</p><p>Let’s look at a sample example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/57f27dbef42594ff5d20047e279eca56/href">https://medium.com/media/57f27dbef42594ff5d20047e279eca56/href</a></iframe><p>After applying the above `AuthorizationPolicy`, all the requests coming to “demo.example.com” will be routed through oauth2-proxy for authorization.</p><p>That’s it, we have externalized the authorization implementation leveraging Istio and Oauth2-proxy capability.</p><p>To summarize, we are using oauth2-proxy to handle external authorization request and Istio will to configure dynamic rules based on which the requests must be authorized.</p><p><strong>Overall Flow: </strong>Incoming Request -&gt; Istio Ingress Gateway -&gt; Authorization Policy -&gt; Oauth2-Proxy -&gt; if(authorized) Application Service -&gt; else Rejected Unauthorized.</p><p>Hope this article gives a glimpse on implementing external authorization using Istio and Oauth2-Proxy. I would love to answer your questions or doubts and leave claps if you find this helpful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5de7cd00ef04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up Latest Istio on MicroK8s (Windows WSL)]]></title>
            <link>https://medium.com/@lucario/setting-up-latest-istio-on-microk8s-windows-wsl-936797bace5c?source=rss-a648fe324490------2</link>
            <guid isPermaLink="false">https://medium.com/p/936797bace5c</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[wsl-2]]></category>
            <category><![CDATA[istio]]></category>
            <dc:creator><![CDATA[Nandan B N]]></dc:creator>
            <pubDate>Sun, 18 Jul 2021 14:42:32 GMT</pubDate>
            <atom:updated>2021-07-18T14:42:32.838Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pre-requisites:</h3><ul><li>MicroK8s latest version installed</li></ul><p>I’m using Windows 10 with WSL2 (Ubuntu Subsystem). You can refer to the article from wsl.dev where they have explained all the troubleshooting areas along with explanation on why and how to do it. (<a href="https://wsl.dev/wsl2-microk8s/">wsl.dev/wsl2-microk8s</a>). Thanks wsl.dev for detailed setup instructions.</p><p>MicroK8s comes with Istio as a add-on but the Istio version is outdated and uses deprecated Istio core components. So, we will not be using MicroK8s add-on</p><h3>Download Istioctl</h3><p>To setup Istio on our cluster we should have the istioctl. A cli tool by Istio which helps us to easily setup the Istio with a simple yaml manifest profile.</p><p>Let’s download the latest release of Istioctl available (v1.10.2 when I’m writing this)</p><pre>curl -L https://istio.io/downloadIstio | sh -<br>cd istio-1.10.2</pre><p>Add the istioctl client to your path (Linux or macOS):</p><pre>export PATH=$PWD/bin:$PATH</pre><p>Verify the cli setup:</p><pre>istioctl version<br>no running Istio pods in &quot;istio-system&quot;<br>1.10.2</pre><h3>Install Istio</h3><p>Now that we have the istioctl ready, let’s install Istio with demo profile since it comes with ingress and egress gateway&#39;s which we&#39;ll be using in future.</p><p>demo: configuration designed to showcase Istio functionality with modest resource requirements. It is suitable to run the Bookinfo application and associated tasks.</p><pre>istioctl install --set profile=demo -y --kubeconfig &lt;KUBE_CONFIG_FILE&gt;<br>✔ Istio core installed                                                                                                                                                                                         <br>✔ Istiod installed<br>✔ Egress gateways installed<br>✔ Ingress gateways installed<br>✔ Installation complete                                                                                                                                                                                                                                                      <br>Thank you for installing Istio 1.10.  Please take a few minutes to tell us about your install/upgrade experience!  <a href="https://forms.gle/KjkrDnMPByq7akrYA">https://forms.gle/KjkrDnMPByq7akrYA</a></pre><p>Verify if the installation happened successfully.</p><pre>kubectl -n istio-system get deploy<br>NAME                   READY   UP-TO-DATE   AVAILABLE   AGE<br>istio-egressgateway    1/1     1            1           25s<br>istio-ingressgateway   1/1     1            1           24s<br>istiod                 1/1     1            1           20s</pre><p>Wonderful! You now have Istio running on your WSL successfully.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=936797bace5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Packer a Complete Guide with Example]]></title>
            <link>https://medium.com/techno101/packer-a-complete-guide-with-example-cf062b7495eb?source=rss-a648fe324490------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf062b7495eb</guid>
            <category><![CDATA[native-image]]></category>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[packers]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Nandan B N]]></dc:creator>
            <pubDate>Fri, 25 Sep 2020 16:18:40 GMT</pubDate>
            <atom:updated>2020-09-25T16:42:10.929Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GP_BvGp4DsBNxfjAaXWZ_Q.jpeg" /></figure><h3>What is Packer?</h3><p>Packer is easy to use and automates the creation of any type of machine image. It embraces modern configuration management by encouraging you to use a framework such as Chef or Puppet to install and configure the software within your Packer-made images.</p><p>Through out this article I have marked direct hyperlinks to Packer official docs whereever necessary.</p><h3>Advantages of Using Packer</h3><ul><li><strong><em>Super fast infrastructure deployment:</em></strong> Packer images allow you to launch completely provisioned and configured machines in seconds, rather than several minutes or hours.</li><li><strong><em>Multi-provider portability:</em></strong> Because Packer creates identical images for multiple platforms, you can run production in AWS, staging/QA in a private cloud like OpenStack, and development in desktop virtualization solutions such as VMware or VirtualBox. Each environment is running an identical machine image, giving ultimate portability.</li><li><strong><em>Improved stability:</em></strong> Packer installs and configures all the software for a machine at the time the image is built. If there are bugs in these scripts, they’ll be caught early, rather than several minutes after a machine is launched.</li><li><strong><em>Greater testability:</em></strong> After a machine image is built, that machine image can be quickly launched and smoke tested to verify that things appear to be working.</li></ul><h3>Key Packer Terminologies</h3><p>The terminology is in alphabetical order for quick referencing.</p><ul><li><strong>Artifacts</strong> are the results of a single build, and are usually a set of IDs or files to represent a machine image. Every builder produces a single artifact. As an example, in the case of the Amazon EC2 builder, the artifact is a set of AMI IDs (one per region). For the VMware builder, the artifact is a directory of files comprising the created virtual machine.</li><li><strong>Builds</strong> are a single task that eventually produces an image for a single platform. Multiple builds run in parallel. Example usage in a sentence: “The Packer build produced an AMI to run our web application.” Or: “Packer is running the builds now for VMware, AWS, and VirtualBox.”</li><li><strong>Builders</strong> are components of Packer that are able to create a machine image for a single platform. Builders read in some configuration and use that to run and generate a machine image. A builder is invoked as part of a build in order to create the actual resulting images. Example builders include VirtualBox, VMware, and Amazon EC2. Builders can be created and added to Packer in the form of plugins.</li><li><strong>Commands</strong> are sub-commands for the packer program that perform some job. An example command is “build”, which is invoked as packer build. Packer ships with a set of commands out of the box in order to define its command-line interface.</li><li><strong>Post-processors</strong> are components of Packer that take the result of a builder or another post-processor and process that to create a new artifact. Examples of post-processors are compress to compress artifacts, upload to upload artifacts, etc.</li><li><strong>Provisioners</strong> are components of Packer that install and configure software within a running machine prior to that machine being turned into a static image. They perform the major work of making the image contain useful software. Example provisioners include shell scripts, Chef, Puppet, etc.</li><li><strong>Templates</strong> are JSON files which define one or more builds by configuring the various components of Packer. Packer is able to read a template and use that information to create multiple machine images in parallel.</li></ul><p>We’ll look more at Builders, Provisioners &amp; Post-Processors later in this article.</p><h3>Installing Hashicorp Packer</h3><p>Packer may be installed in the following ways by visiting the official packer downloads page: <a href="https://www.packer.io/downloads.html">https://www.packer.io/downloads.html</a></p><h3>Basic Ready to Use Template</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3818c4e71af2d7755bfbf15454318464/href">https://medium.com/media/3818c4e71af2d7755bfbf15454318464/href</a></iframe><p>When building, we’ll pass in aws_access_key and aws_secret_key as <a href="https://www.packer.io/docs/templates/user-variables.html">user variables</a>, keeping your secret keys out of the template.</p><h3>Environment variables</h3><p>You can provide your credentials via the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, environment variables, representing your AWS Access Key and AWS Secret Key, respectively. Note that setting your AWS credentials using either these environment variables will override the use of AWS_SHARED_CREDENTIALS_FILE and AWS_PROFILE. The AWS_DEFAULT_REGION and AWS_SESSION_TOKEN environment variables are also used, if applicable:</p><p><strong>Usage:</strong></p><p>export AWS_ACCESS_KEY_ID=”anaccesskey”</p><p>export AWS_SECRET_ACCESS_KEY=”asecretkey”</p><p>export AWS_DEFAULT_REGION=”us-west-2&quot;</p><h3>Shared Credentials file</h3><p>You can use an AWS credentials file to specify your credentials. The default location is `$HOME/.aws/credentials` on Linux and OS X, or `“%USERPROFILE%\.aws\credentials”` for Windows users. If we fail to detect credentials inline, or in the environment, Packer will check this location. You can optionally specify a different location in the configuration by setting the environment with the AWS_SHARED_CREDENTIALS_FILE variable.</p><p>The format for the credentials file is like so</p><pre>[default]<br>aws_access_key_id=&lt;your access key id&gt;<br>aws_secret_access_key=&lt;your secret access key&gt;</pre><p>You may also configure the profile to use by setting the profile configuration option, or setting the AWS_PROFILE environment variable:</p><pre>{<br>  &quot;profile&quot;: &quot;customprofile&quot;,<br>  &quot;region&quot;: &quot;us-east-1&quot;,<br>  &quot;type&quot;: &quot;amazon-ebs&quot;<br>}</pre><h3>What are Builders?</h3><p>A builder is a component of Packer that is responsible for creating a machine and turning that machine into an image. The builders section contains an array of JSON objects configuring a specific <em>builder</em>.</p><p>In this case, we’re only configuring a single builder of type amazon-ebs. This is the Amazon EC2 AMI builder that ships with Packer. This builder builds an EBS-backed AMI by launching a source AMI, provisioning on top of that, and re-packaging it into a new AMI.</p><pre>&quot;builders&quot;: [{<br>  &quot;type&quot;: &quot;amazon-ebs&quot;,<br>  &quot;access_key&quot;: &quot;{{user `aws_access_key`}}&quot;,<br>  &quot;secret_key&quot;: &quot;{{user `aws_secret_key`}}&quot;,<br>  &quot;region&quot;: &quot;us-east-1&quot;,<br>  &quot;source_ami_filter&quot;: {<br>    &quot;filters&quot;: {<br>      &quot;virtualization-type&quot;: &quot;hvm&quot;,<br>      &quot;name&quot;: &quot;ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*&quot;,<br>      &quot;root-device-type&quot;: &quot;ebs&quot;<br>    },<br>    &quot;owners&quot;: [&quot;099720109477&quot;],<br>    &quot;most_recent&quot;: <strong>true<br>  </strong>},<br>  &quot;instance_type&quot;: &quot;t2.micro&quot;,<br>  &quot;ssh_username&quot;: &quot;ubuntu&quot;,<br>  &quot;ami_name&quot;: &quot;packer-example {{timestamp}}&quot;<br>}]</pre><p><strong>Required Properties for Builder:</strong></p><p><a href="https://www.packer.io/docs/builders/amazon-ebs.html#access_key">access_key</a> (string) — The access key used to communicate with AWS. <a href="https://www.packer.io/docs/builders/amazon.html#specifying-amazon-credentials">Learn how to set this</a>. This is not required if you are using use_vault_aws_engine for authentication instead.</p><p><a href="https://www.packer.io/docs/builders/amazon-ebs.html#ami_name">ami_name</a> (string) — The name of the resulting AMI that will appear when managing AMIs in the AWS console or via APIs. This must be unique. To help make this unique, use a function like timestamp (see <a href="https://www.packer.io/docs/templates/engine.html">template engine</a> for more info).</p><p><a href="https://www.packer.io/docs/builders/amazon-ebs.html#instance_type">instance_type</a> (string) — The EC2 instance type to use while building the AMI, such as t2.small.</p><p><a href="https://www.packer.io/docs/builders/amazon-ebs.html#region">region</a> (string) — The name of the region, such as us-east-1, in which to launch the EC2 instance to create the AMI.</p><p><a href="https://www.packer.io/docs/builders/amazon-ebs.html#secret_key">secret_key</a> (string) — The secret key used to communicate with AWS. <a href="https://www.packer.io/docs/builders/amazon.html#specifying-amazon-credentials">Learn how to set this</a>. This is not required if you are using use_vault_aws_engine for authentication instead.</p><p><a href="https://www.packer.io/docs/builders/amazon-ebs.html#source_ami">source_ami</a> (string) — The initial AMI used as a base for the newly created machine. source_ami_filter may be used instead to populate this automatically.</p><p><strong>Optional:</strong></p><p><a href="https://www.packer.io/docs/builders/amazon-ebs.html#source_ami_filter">source_ami_filter</a> (object) — Filters used to populate the source_ami field.</p><p>This selects the most recent Ubuntu 16.04 HVM EBS AMI from Canonical. NOTE: This will fail unless exactly one AMI is returned. In the above example, most_recent will cause this to succeed by selecting the newest image.</p><p><strong>filters</strong> (map of strings) — filters used to select a source_ami. NOTE: This will fail unless exactly one AMI is returned. Any filter described in the docs for <a href="http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html">DescribeImages</a> is valid.</p><p><strong>owners</strong> (array of strings) — Filters the images by their owner. You may specify one or more AWS account IDs, “self” (which will use the account whose credentials you are using to run Packer), or an AWS owner alias: for example, amazon, aws-marketplace, or microsoft. This option is required for security reasons.</p><p><strong>most_recent </strong>(boolean) — Selects the newest created image when true. This is most useful for selecting a daily distro build.</p><p>You may set this in place of source_ami or in conjunction with it. If you set this in conjunction with source_ami, the source_ami will be added to the filter. The provided source_ami must meet all of the filtering criteria provided in source_ami_filter; this pins the AMI returned by the filter, but will cause Packer to fail if the source_ami does not exist.</p><p>These are basic configuration criteria required for a basic image creation. You can find the detailed options which we can specify by going through particular builder configuration</p><p>The above shown are the configuration options which we can use for — <strong>Amazon EBS instance </strong><a href="https://www.packer.io/docs/builders/amazon-ebs.html">https://www.packer.io/docs/builders/amazon-ebs.html</a></p><p><strong>Azure</strong> requires some additional setup for creating ARM images will detail in further documentation</p><p><a href="https://www.packer.io/docs/builders/azure-setup.html">https://www.packer.io/docs/builders/azure-setup.html</a></p><h3>What are Provisioners?</h3><p>Provisioners use builtin and third-party software to install and configure the machine image after booting. Provisioners prepare the system for use, so common use cases for provisioners include:</p><ul><li>Installing packages</li><li>Patching the kernel</li><li>Creating users</li><li>Downloading application code</li></ul><p>Packer has support for huge set provisioners which we can use,</p><p><a href="https://www.packer.io/docs/provisioners/ansible-local.html">Ansible Local</a>, <a href="https://www.packer.io/docs/provisioners/ansible.html">Ansible (Remote)</a>, <a href="https://www.packer.io/docs/provisioners/breakpoint.html">Breakpoint</a>, <a href="https://www.packer.io/docs/provisioners/chef-client.html">Chef Client</a>, <a href="https://www.packer.io/docs/provisioners/chef-solo.html">Chef Solo</a>, <a href="https://www.packer.io/docs/provisioners/converge.html">Converge</a>, <a href="https://www.packer.io/docs/provisioners/file.html">File</a>, <a href="https://www.packer.io/docs/provisioners/inspec.html">InSpec</a>, <a href="https://www.packer.io/docs/provisioners/powershell.html">PowerShell</a> ,<a href="https://www.packer.io/docs/provisioners/puppet-masterless.html">Puppet Masterless</a>, <a href="https://www.packer.io/docs/provisioners/puppet-server.html">Puppet Server</a>, <a href="https://www.packer.io/docs/provisioners/salt-masterless.html">Salt Masterless</a>, <a href="https://www.packer.io/docs/provisioners/shell.html">Shell</a>, <a href="https://www.packer.io/docs/provisioners/shell-local.html">Shell (Local)</a>, <a href="https://www.packer.io/docs/provisioners/windows-shell.html">Windows Shell</a>, <a href="https://www.packer.io/docs/provisioners/windows-restart.html">Windows Restart</a>, <a href="https://www.packer.io/docs/provisioners/custom.html">Custom</a></p><p>Each provisioner will have set of options required to be set in order for them to work.</p><p><strong>Let’s Have Look at File Provisioner for Example</strong></p><p>The file Packer provisioner uploads files to machines built by Packer. The recommended usage of the file provisioner is to use it to upload files, and then use <a href="https://www.packer.io/docs/provisioners/shell.html">shell provisioner</a> to move them to the proper place, set permissions, etc.</p><p><strong>NOTE</strong>: You can only upload files to locations that the provisioning user (generally not root) has permission to access. Creating files in /tmp and using a shell provisioner to move them into the final location is the only way to upload files to root owned locations.</p><pre>{<br>  &quot;type&quot;: &quot;file&quot;,<br>  &quot;source&quot;: &quot;app.tar.gz&quot;,<br>  &quot;destination&quot;: &quot;/tmp/app.tar.gz&quot;<br>}</pre><h3>What are Post-Processors?</h3><p>Post-processors run after the image is built by the builder and provisioned by the provisioner(s). Post-processors are optional, and they can be used to upload artifacts, re-package, or more. For more information about post-processors, please choose an option from the sidebar.</p><h3>­­­Running Packer Build</h3><p>To build image use below commandm</p><pre>packer build example.json</pre><p>Available commands are:</p><ul><li><strong>build:</strong> build image(s) from template</li><li><strong>console:</strong> check that a template is valid</li><li><strong>fix:</strong> fixes templates from old versions of packer</li><li><strong>inspect:</strong> see components of a template</li><li><strong>validate:</strong> check that a template is valid</li><li><strong>version:</strong> Prints the Packer version</li></ul><h3>A Complete Packer Template Example</h3><p>We have looked into all the major packer terminlogies and how to use them. Let’s now create a new template, which involves all that we learned and try it out:</p><p><strong>A sample ready to go template example for AMI Ubuntu with MySQL</strong></p><p>This example combines variables, provisioners and builders in a single file. The below template is tested with AWS EC2.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba392487ffe9949eb51bb3893db3a07f/href">https://medium.com/media/ba392487ffe9949eb51bb3893db3a07f/href</a></iframe><p>As you can see in the above template JSON. we are using a shell provisioner which executes the mysql.sh script. Let’s create the shell script for mysql installation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef4aa63e9fc170e8fe073ac3e56b614d/href">https://medium.com/media/ef4aa63e9fc170e8fe073ac3e56b614d/href</a></iframe><p>Now we have everything ready. Let’s do the build with template that we created above.</p><p>Run the below command to build an AWS native AMI image: (In the below command path is wrt the <a href="https://github.com/itsLucario/packer-casic-example">github example</a>)</p><pre>packer build ./templates/ubuntu-mysql.json</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*lymHwXrJ4WxHwiffG60O-A.png" /><figcaption>packer build output</figcaption></figure><p>Once the build gets successful, an AMI will get created in the specified region in our case its us-east-1 . You can login to your AWS Console, Open the Amazon EC2 console at <a href="https://console.aws.amazon.com/ec2/">https://console.aws.amazon.com/ec2/</a> and In the navigation pane, choose <strong>AMIs</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dHdAAfNRL8xGXp6EdZ-zOg.png" /></figure><p>You can see in the above image an AMI got created which matches with the AMI ID show in our terminal. You can use the image to create an instance right away.</p><p>Take a look at the working example on my GitHub. Feel free to leave a comment and don’t forget to leave claps and follow me if you find this helpful.</p><p><a href="https://github.com/itsLucario/packer-basic-example">itsLucario/packer-basic-example</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf062b7495eb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techno101/packer-a-complete-guide-with-example-cf062b7495eb">Packer a Complete Guide with Example</a> was originally published in <a href="https://medium.com/techno101">The Jabberjays</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ionic v5 BrowserTab with Custom Tab Color]]></title>
            <link>https://medium.com/techno101/ionic-v5-browsertab-with-custom-tab-color-df1f3a5e994b?source=rss-a648fe324490------2</link>
            <guid isPermaLink="false">https://medium.com/p/df1f3a5e994b</guid>
            <category><![CDATA[ionic]]></category>
            <category><![CDATA[google-chrome]]></category>
            <category><![CDATA[browser-tabs]]></category>
            <category><![CDATA[cordova]]></category>
            <category><![CDATA[custom-color]]></category>
            <dc:creator><![CDATA[Nandan B N]]></dc:creator>
            <pubDate>Sat, 12 Sep 2020 12:44:42 GMT</pubDate>
            <atom:updated>2020-09-21T12:31:29.454Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3A6oECCPwIOUxp1mfbZR9Q.jpeg" /></figure><p>BrowserTab plugin provides an interface to in-app browser tabs that exist on some mobile platforms, specifically Custom Tabs on Android (including the Chrome Custom Tabs implementation), and SFSafariViewController on iOS.</p><p>The plugin we’ll be looking at today is a fork from the official <a href="https://github.com/google/cordova-plugin-browsertab">google/cordova-plugin-browsertab</a>. Since there are no active maintainers of the repository, developers are facing many issues with the plugin.</p><p>Link for the fork with fixes and enabling BrowserTab with Custom Color:<br><a href="https://github.com/itsLucario/cordova-plugin-browsertab">https://github.com/itsLucario/cordova-plugin-browsertab</a></p><h3>Steps To Get It Working For Your App</h3><p>First install the Ionic’s official browser tab JS library, which helps you to get easy access for the Cordova BrowserTab Plugin.</p><pre>npm install @ionic-native/browser-tab</pre><p>After the installation, install the cordova-browser-tab plugin by using the below command:</p><pre>cordova plugin add @lucario/cordova-plugin-browsertab --variable CUSTOM_TAB_COLOR_RGB=”#ff0000&quot;</pre><p>You can change the variable CUSTOM_TAB_COLOR_RGB with whichever color you want in HEX format. Once the plugin gets installed, you can access the plugin in your Angular code as shown below.</p><pre>import { BrowserTab } from ‘<a href="http://twitter.com/ionic">@ionic</a>-native/browser-tab/ngx’;</pre><pre>constructor(private browserTab: BrowserTab) {</pre><pre> browserTab.isAvailable()<br> .then(isAvailable =&gt; {<br> if (isAvailable) {<br> browserTab.openUrl(‘<a href="https://ionic.io&/#39;">https://ionic.io&#39;</a>);<br> } else {<br> // open URL with InAppBrowser instead or SafariViewController<br> }<br> });<br>}</pre><p>Although the changing browser tab color feature is merged with master branch, they have not rolled this feature out to npm repository. That is the reason you won’t get custom color working when you try to install it from official repository.</p><h3>Points you should keep in mind:</h3><ul><li>This plugin can only take one color, which is set using variable CUSTOM_TAB_COLOR_RGB during the installation of the plugin.</li><li>Also, this plugin force opens custom tab with Google Chrome by default, which I haven’t found being done in any of the PR/forks. If the user doesn’t have Google Chrome installed in his/her device, an action choice will be shown. This will give a good user experience cause all links are force opened with Chrome tab without an asking prompt.</li><li>Unnecessary dependency “cordova-plugin-compat” is removed since its deprecated.</li></ul><ul><li><a href="https://www.npmjs.com/package/@lucario/cordova-plugin-browsertab">@lucario/cordova-plugin-browsertab</a></li><li><a href="https://github.com/itsLucario/cordova-plugin-browsertab">itsLucario/cordova-plugin-browsertab</a></li></ul><p>If this helps don’t forget to leave your claps 😉 and comment if you have any queries.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df1f3a5e994b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techno101/ionic-v5-browsertab-with-custom-tab-color-df1f3a5e994b">Ionic v5 BrowserTab with Custom Tab Color</a> was originally published in <a href="https://medium.com/techno101">The Jabberjays</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>