<?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 Neeraj Agrawal on Medium]]></title>
        <description><![CDATA[Stories by Neeraj Agrawal on Medium]]></description>
        <link>https://medium.com/@neeraj-agrawal?source=rss-18903dd7c8fa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5mKiPp7s_pcf6Egg</url>
            <title>Stories by Neeraj Agrawal on Medium</title>
            <link>https://medium.com/@neeraj-agrawal?source=rss-18903dd7c8fa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 12:54:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@neeraj-agrawal/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[Mastering the Mind: Wisdom from the Bhagavad Gita and Yoga Sutras]]></title>
            <link>https://neeraj-agrawal.medium.com/geeta-teachings-eb2b0b4cd6ef?source=rss-18903dd7c8fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb2b0b4cd6ef</guid>
            <dc:creator><![CDATA[Neeraj Agrawal]]></dc:creator>
            <pubDate>Mon, 15 Jun 2026 17:22:49 GMT</pubDate>
            <atom:updated>2026-12-05T22:40:42.144Z</atom:updated>
            <content:encoded><![CDATA[<h4>वक्रतुण्ड महाकाय सूर्यकोटि समप्रभ | निर्विघ्नं कुरु मे देव सर्वकार्येषु सर्वदा ||</h4><h3><strong>Introduction</strong></h3><p>The foundation of mental well-being, as described in ancient Indian philosophy, begins with understanding the nature of the mind. Patanjali’s Yoga Sutras explain how mental fluctuations influence our experience and how we can learn to observe and regulate them. The Bhagavad Gita takes this understanding further, showing how to apply mental discipline, emotional regulation and equanimity in everyday life. As a personal experience, recommendation is to start with Geeta first and then Yogasutra.</p><h3><strong>Foundational concept from Patanjali Yogasutra</strong></h3><p><strong>Raja Yoga</strong> focuses on mastering the mind through meditation and ethics, while <strong>Hatha Yoga</strong> uses physical postures and breathwork to prepare the body for that mental stillness. Yogasutra covers Raja Yoga. Yogasutra talks about eight limbs (<em>ashtang ) </em>yoga.</p><p>योगश्चित्तवृत्तिनिरोधः ॥ १.२ ॥ तदा द्रष्टुः स्वरूपेऽवस्थानम् ॥ १.३ ॥</p><p>Yoga is the cessation or restraint of the fluctuations of the mind-field. Then the seer abides in its own true nature.</p><h3><strong>Geeta</strong></h3><p><strong>क्लैब्यं मा स्म गम: पार्थ नैतत्त्वय्युपपद्यते |<br>क्षुद्रं हृदयदौर्बल्यं त्यक्त्वोत्तिष्ठ परन्तप || Chapter 2- 3||</strong></p><p>Lord Krishna reminds Arjun that fear and helplessness are temporary mental states, not his true nature and commands him to rise with courage and fulfill his dharma.</p><p>Essentially, don’t give up. When ever you start to feel weak (see <strong>Chapter 18–35</strong>), arise from that state, taker necessary actions, be persistent and follow the advice of verse 47 while being on path of dharma.</p><p><strong>कर्मण्येवाधिकारस्ते मा फलेषु कदाचन |<br>मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि || Chapter 2 - 47 ||</strong></p><p>You have the right to work only, and not to the fruits of work. Let not the fruit of action be your motive, nor let your attachment be to inaction.</p><p><strong>योगस्थ: कुरु कर्माणि सङ्गं त्यक्त्वा धनञ्जय |<br>सिद्ध्यसिद्ध्यो: समो भूत्वा समत्वं योग उच्यते || Chapter 2- 48||</strong></p><p>Lord Krishna advises Arjuna to perform his duty with steadfastness, abandoning all attachment to success or failure. He defines this state of perfect mental equilibrium — remaining even-minded in both favorable and unfavorable circumstances — as the true practice of Yoga.</p><p><strong>दु:खेष्वनुद्विग्नमना: सुखेषु विगतस्पृह: |<br>वीतरागभयक्रोध: स्थितधीर्मुनिरुच्यते || 56||</strong></p><p>One whose mind remains undisturbed amidst misery, who does not crave for pleasure, and who is free from attachment, fear, and anger, is called a sage of steady wisdom.</p><p><strong>ध्यायतो विषयान्पुंस: सङ्गस्तेषूपजायते |<br>सङ्गात्सञ्जायते काम: कामात्क्रोधोऽभिजायते || Chapter 2-62||</strong></p><p><strong>क्रोधाद्भवति सम्मोह: सम्मोहात्स्मृतिविभ्रम: |<br>स्मृतिभ्रंशाद् बुद्धिनाशो बुद्धिनाशात्प्रणश्यति || Chapter 2-63||</strong></p><p>While contemplating on the objects of the senses, one develops attachment to them. Attachment leads to desire, and from desire arises anger. Anger leads to clouding of judgment, which results in bewilderment of memory. When memory is bewildered, the intellect gets destroyed; and when the intellect is destroyed, one is ruined.</p><p><strong>रागद्वेषवियुक्तैस्तु विषयानिन्द्रियैश्चरन् |<br>आत्मवश्यैर्विधेयात्मा प्रसादमधिगच्छति || Chapter 2-64||</strong></p><p>But one who controls the mind, and is free from attachment and aversion, even while using the objects of the senses, attains peace.</p><p><strong>इन्द्रियस्येन्द्रियस्यार्थे रागद्वेषौ व्यवस्थितौ |<br>तयोर्न वशमागच्छेत्तौ ह्यस्य परिपन्थिनौ || Chapter 3-34||</strong></p><p>Lord Krishna teaches Arjuna about the dangers of unchecked desires. He explains that attraction (likes) and repulsion (dislikes) are natural to the senses, but cautions that a person should never fall under their control, as these opposing forces act as major stumbling blocks on the path to spiritual realization.</p><p><strong>काम एष क्रोध एष रजोगुणसमुद्भव: ||<br>महाशनो महापाप्मा विद्ध्येनमिह वैरिणम् || Chapter 3-37||</strong></p><p>It is the desire which is born of contact with the mode of passion(रजोगुण), and later transformed into anger. Know this as the sinful, all-devouring enemy in the world.</p><p><strong>अपाने जुह्वति प्राणं प्राणेऽपानं तथापरे ।<br>प्राणापानगती रुद्ध्वा प्राणायामपरायणा: ॥ 4-29॥</strong></p><p>Others offer the outward breath into the inward breath, and also the inward breath into the outward breath. Halting the movement of both these breaths, they constantly engage in <a href="https://www.youtube.com/watch?v=JoDKbXEUrvQ&amp;t=400s">praanaayaam</a>.</p><p><strong>ये हि संस्पर्शजा भोगा दु:खयोनय एव ते |<br>आद्यन्तवन्त: कौन्तेय न तेषु रमते बुध: || Chapter 5-22||</strong></p><p>The pleasures that arise from contact with the sense objects, though appearing as enjoyable to worldly-minded people, are verily a source of misery. O son of Kunti (Arjun), such pleasures have a beginning and an end, so the wise do not delight in them.</p><p><strong>शक्नोतीहैव य: सोढुं प्राक्शरीरविमोक्षणात् |<br>कामक्रोधोद्भवं वेगं स युक्त: स सुखी नर: || Chapter 5-23||</strong></p><p>Who before giving up the body are able to check the forces of desire and anger; are yogis in this world and they alone are happy.</p><p><strong>स्पर्शान्कृत्वा बहिर्बाह्यांश्चक्षुश्चैवान्तरे भ्रुवो: ।<br>प्राणापानौ समौ कृत्वा नासाभ्यन्तरचारिणौ ॥ Chapter 5-27॥<br>यतेन्द्रियमनोबुद्धिर्मुनिर्मोक्षपरायण: ।<br>विगतेच्छाभयक्रोधो य: सदा मुक्त एव स: ॥ Chapter 5-28॥</strong></p><p>Shutting out all thoughts of external enjoyment, with the gaze fixed on the space between the eye-brows, equalizing the flow of the incoming and outgoing breath in the nostrils, and thus controlling the senses, mind, and intellect, the sage who becomes free from desire, fear, and anger, always lives in freedom.</p><p><strong>उद्धरेदात्मनात्मानं नात्मानमवसादयेत् |<br>आत्मैव ह्यात्मनो बन्धुरात्मैव रिपुरात्मन: || Chapter 6-5||</strong></p><p>Elevate yourself through the power of your mind, and not degrade yourself, for the mind can be the friend and also the enemy of the self.</p><p><strong>यतो यतो निश्चरति मनश्चञ्चलमस्थिरम् ।<br>ततस्ततो नियम्यैतदात्मन्येव वशं नयेत् ॥6–26||</strong></p><p>From whatever cause the restless and unsteady mind wanders away, restrain it and bring it under the control of the Self.</p><p><strong>असंशयं महाबाहो मनो दुर्निग्रहं चलम् |<br>अभ्यासेन तु कौन्तेय वैराग्येण च गृह्यते || 6-35||</strong></p><p>Lord Krishna said: O mighty-armed son of Kunti (Arjun), what you say is correct; the mind is indeed very difficult to restrain. But by practice and detachment, it can be controlled.</p><p><strong>यस्मान्नोद्विजते लोको लोकान्नोद्विजते च य: |<br>हर्षामर्षभयोद्वेगैर्मुक्तो य: स च मे प्रिय: || Chapter 12 -15||</strong></p><p>Those who are not a source of distress to anyone and who in turn are not distressed by anyone, who are equal in pleasure and pain, and free from fear and anxiety, such devotees of Mine are very dear to Me.</p><p>Chapter 13: 7–11, 12–18</p><p><strong>अमानित्वमदम्भित्वमहिंसा क्षान्तिरार्जवम् ।<br>आचार्योपासनं शौचं स्थैर्यमात्मविनिग्रह: ॥ 8॥<br>इन्द्रियार्थेषु वैराग्यमनहङ्कार एव च ।<br>जन्ममृत्युजराव्याधिदु:खदोषानुदर्शनम् ॥ 9॥<br>असक्तिरनभिष्वङ्ग: पुत्रदारगृहादिषु ।<br>नित्यं च समचित्तत्वमिष्टानिष्टोपपत्तिषु ॥ 10॥<br>मयि चानन्ययोगेन भक्तिरव्यभिचारिणी ।<br>विविक्तदेशसेवित्वमरतिर्जनसंसदि ॥ 11॥<br>अध्यात्मज्ञाननित्यत्वं तत्वज्ञानार्थदर्शनम् ।<br>एतज्ज्ञानमिति प्रोक्तमज्ञानं यदतोऽन्यथा ॥ 12॥</strong></p><p>Humbleness; freedom from hypocrisy; non-violence; forgiveness; simplicity; service of the Guru; cleanliness of body and mind; steadfastness; and self-control; dispassion toward the objects of the senses; absence of egotism; keeping in mind the evils of birth, disease, old age, and death; non-attachment; absence of clinging to spouse, children, home, and so on; even-mindedness amidst desired and undesired events in life; constant and exclusive devotion toward Me; an inclination for solitary places and an aversion for mundane society; constancy in spiritual knowledge; and philosophical pursuit of the Absolute Truth — all these I declare to be knowledge, and what is contrary to it, I call ignorance.</p><p>Chapter 14: 24–25</p><p><strong>समदु:खसुख: स्वस्थ: समलोष्टाश्मकाञ्चन: |<br>तुल्यप्रियाप्रियो धीरस्तुल्यनिन्दात्मसंस्तुति: || 24||<br>मानापमानयोस्तुल्यस्तुल्यो मित्रारिपक्षयो: |<br>सर्वारम्भपरित्यागी गुणातीत: स उच्यते || 25||</strong></p><p>Those who are alike in happiness and distress; who are established in the self; who look upon a clod, a stone, and a piece of gold as of equal value; who remain the same amidst pleasant and unpleasant events; who are intelligent; who accept both blame and praise with equanimity; who remain the same in honor and dishonor; who treat both friend and foe alike; and who have abandoned ego driven enterprises or undertakings — they are said to have risen above the three <em>guṇas</em>. (one who has transcended the three modes of material nature: <em>Sattva</em>, <em>Rajas</em>, and <em>Tamas</em>)</p><p><strong>अभयं सत्त्वसंशुद्धिर्ज्ञानयोगव्यवस्थिति: |<br>दानं दमश्च यज्ञश्च स्वाध्यायस्तप आर्जवम् || Chapter 16 -1||<br>अहिंसा सत्यमक्रोधस्त्याग: शान्तिरपैशुनम् |<br>दया भूतेष्वलोलुप्त्वं मार्दवं ह्रीरचापलम् || Chapter 16- 2||<br>तेज: क्षमा धृति: शौचमद्रोहोनातिमानिता |<br>भवन्ति सम्पदं दैवीमभिजातस्य भारत || Chapter 16- 3||</strong></p><p>Lord Krishna says — these are the saintly virtues of those endowed with a divine nature — fearlessness, purity of mind, steadfastness in spiritual knowledge, charity, control of the senses, sacrifice, study of the sacred books, austerity, and straightforwardness; non-violence, truthfulness, absence of anger, renunciation, peacefulness, restraint from fault-finding, compassion toward all living beings, absence of covetousness, gentleness, modesty, and lack of fickleness; vigor, forgiveness, fortitude, cleanliness, bearing enmity toward none, and absence of vanity.</p><p><strong>त्रिविधं नरकस्येदं द्वारं नाशनमात्मन: |<br>काम: क्रोधस्तथा लोभस्तस्मादेतत्त्रयं त्यजेत् || Chapter 16 — 21||</strong></p><p>There are three gates leading to the hell of self-destruction for the soul — lust, anger, and greed. Therefore, one should abandon all three.</p><p><strong>अनुद्वेगकरं वाक्यं सत्यं प्रियहितं च यत् |<br>स्वाध्यायाभ्यसनं चैव वाङ्मयं तप उच्यते || Chapter 17 — 15||</strong></p><p>Lord Krishna defines the <em>tapa (</em>severe self-discipline) of speech. He explains that proper verbal discipline involves speaking in a truthful, pleasant, and beneficial manner without agitating others, and includes the regular recitation of scriptures.</p><p><strong>मन: प्रसाद: सौम्यत्वं मौनमात्मविनिग्रह: |<br>भावसंशुद्धिरित्येतत्तपो मानसमुच्यते || Chapter 17 — 16||</strong></p><p>Lord Krishna defines the <em>tapa (</em>severe self-discipline) of mind. Serenity of thought, gentleness, silence, self-control, and purity of purpose.</p><p><strong>धृत्या यया धारयते मन:प्राणेन्द्रियक्रिया: |<br>योगेनाव्यभिचारिण्या धृति: सा पार्थ सात्त्विकी || Chapter 18 -33||</strong></p><p>Lord Krishna defines the pure determination (<em>dhriti*) </em>as the unbending willpower that helps a seeker steadily regulate their mind, life-force (<em>prana</em>), and senses through the disciplined practice of meditation (dhyan-yoga).</p><p>( How:</p><p><strong>युक्ताहारविहारस्य युक्तचेष्टस्य कर्मसु ।<br>युक्तस्वप्नावबोधस्य योगो भवति दु:खहा ॥ Chapter 6 — 17॥</strong></p><p>But those who are temperate in eating and recreation, balanced in work, and regulated in sleep, can mitigate all sorrows by practicing Yog</p><p>Also, Yogsutra 1.33 : 1.39 can be considered for meditation:</p><p>By cultivating attitudes of friendliness towards the happy, compassion for the unhappy, delight in the virtuous and disregard toward the wicked, the mind-stuff retains its undisturbed calmness.</p><p>Or that calm is retained by the controlled exhalation or retention of the breath.</p><p>Or the concentration on subtle sense perceptions can cause steadiness of mind.</p><p>Or by concentrating on the supreme, ever-blissful Light within.</p><p>Or by concentrating on a great soul’s mind which is totally freed from attachment to sense objects.</p><p>Or by concentrating on an experience had during dream or sleep.</p><p>Or by meditating on anything one chooses that is elevating.)</p><p><strong>यया स्वप्नं भयं शोकं विषादं मदमेव च |<br>न विमुञ्चति दुर्मेधा धृति: सा पार्थ तामसी || Chapter 18 — 35||</strong></p><p>Lord Krishna defines bad determination ( <em>Tamasic Dhriti</em> ) in the mode of ignorance, fear, grief, despair and conceit. He explains that this is a misguided, self-defeating willpower where a person stubbornly clings to negativity, harmful habits, and destructive mental states. ( instead, follow what is mentioned in 18-33 )</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb2b0b4cd6ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tools and utilities used in Kubernetes]]></title>
            <link>https://neeraj-agrawal.medium.com/tools-and-utilities-used-in-kubernetes-2ce25c441453?source=rss-18903dd7c8fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ce25c441453</guid>
            <dc:creator><![CDATA[Neeraj Agrawal]]></dc:creator>
            <pubDate>Sat, 09 Mar 2024 20:39:39 GMT</pubDate>
            <atom:updated>2024-03-09T20:45:51.583Z</atom:updated>
            <content:encoded><![CDATA[<p>My list of tools, addons, utilities whatever is right name!</p><p><a href="https://docs.nginx.com/nginx-ingress-controller/">nginx ingress controller</a></p><p><a href="https://github.com/external-secrets/external-secrets">external secrets Operator</a></p><p><a href="https://github.com/kubernetes-sigs/external-dns">external DNS</a></p><p><a href="https://keda.sh/">keda</a></p><p><a href="https://codeberg.org/hjacobs/kube-downscaler">downscaler</a></p><p><a href="https://karpenter.sh/">Karpenter</a></p><p><a href="https://docs.tigera.io/calico/latest/about/">Calico</a></p><p><a href="https://github.com/sbstp/kubie">kubie</a></p><p><a href="https://k9scli.io/">k9s</a></p><p><a href="https://github.com/int128/kubelogin">kubelogin</a></p><p>What do you use?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ce25c441453" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cross Account EKS Cluster Access with AWS IAM roles]]></title>
            <link>https://neeraj-agrawal.medium.com/cross-account-eks-cluster-access-3482f7c96d9f?source=rss-18903dd7c8fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/3482f7c96d9f</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cross-account]]></category>
            <category><![CDATA[ek]]></category>
            <dc:creator><![CDATA[Neeraj Agrawal]]></dc:creator>
            <pubDate>Wed, 04 Aug 2021 19:03:25 GMT</pubDate>
            <atom:updated>2024-05-21T20:54:16.388Z</atom:updated>
            <content:encoded><![CDATA[<p>Some times back I came across a use case when I have to access a EKS cluster from another. You can think that your code deployed on a pod in one cluster creates or accesses resource in another.</p><p>In this post I am calling them Dev &amp; Shared Services cluster and Shared Services cluster needs access to Dev ( or Integration, QA, Prod ! )</p><p>This can be achieved by assigning role to pod running in Shared Services account and properly plumbing in the roles on both accounts.</p><h4><strong>In dev Account cluster</strong></h4><pre><strong>Add Policy</strong></pre><pre>arn:aws:iam::&lt;DevAccount&gt;:policy/testpolicy<br>{ <br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>   &quot;Statement&quot;: [<br>      {<br>          &quot;Effect&quot;: &quot;Allow&quot;,<br>          &quot;Action&quot;: [<br>            &quot;eks:*&quot;<br>            ],<br>          &quot;Resource&quot;: &quot;*&quot;  #scope down to cluster resource urn<br>       }<br>     ]<br>}</pre><pre><strong>And role - to establish trust relationship with Shared services. This is allowing </strong>&lt;SSAccount&gt;:role to Assume role in dev cluster</pre><pre>arn:aws:iam::&lt;DevAccount&gt;:role/testrole<br>{ <br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>   &quot;Statement&quot;: [<br>      {<br>          &quot;Effect&quot;: &quot;Allow&quot;,<br>          &quot;Principal&quot;: {<br>            &quot;AWS&quot;: &quot;arn:aws:iam::&lt;SSAccount&gt;:role/&lt;rolename&gt;&quot;<br>           },<br>          &quot;Action&quot;: &quot;sts:AssumeRole&quot;,<br>          &quot;Condition&quot;: {}</pre><pre>       }<br>     ]<br>}<br>Attach above policy to this role.</pre><p><strong>In Shared Services</strong></p><pre><br>arn:aws:iam::&lt;SSAccount&gt;:role/&lt;rolename&gt;</pre><pre>This role is assigned to the pod service account following <a href="https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html">https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html</a>.  The trust relationship for this role should look like this:</pre><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: {<br>        &quot;Federated&quot;: &quot;arn:aws:iam::&lt;SSAccount&gt;:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/&lt;cluster id&gt;&quot;<br>      },<br>      &quot;Action&quot;: &quot;sts:AssumeRoleWithWebIdentity&quot;,<br>      &quot;Condition&quot;: {<br>        &quot;StringEquals&quot;: {<br>          &quot;oidc.eks.us-east-1.amazonaws.com/id/&lt;cluster id&gt;:sub&quot;: &quot;system:serviceaccount:&lt;eks ns&gt;:&lt;service account&gt;&quot;<br>        }<br>      }<br>    }<br>  ]<br>}</pre><pre><strong>Add this policy to above role to enable assume dev role</strong><br>{ <br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>   &quot;Statement&quot;: [<br>      {<br>          &quot;Effect&quot;: &quot;Allow&quot;,<br>          &quot;Action&quot;: [<br>            &quot;sts:AssumeRole&quot;<br>            ],<br>          &quot;Resource&quot;: arn:aws:iam::&lt;DevAccount&gt;:role/testrole<br>       }<br>     ]<br>}</pre><pre>Use kubernetes config file with this section to get a token for authentication with an Amazon EKS cluster. This token is valid for 15 mins max.</pre><pre>( <a href="https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html">https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html</a> )</pre><pre>user: <br>    exec:<br>       apiVersion: client.authentication.k8s.io/v1alpha1<br>       command: aws<br>       args:         <br>         - eks        <br>         - get-token        <br>         - --cluster-name         <br>         - <em>&lt;cluster-name&gt;</em>      <br>         <em>- --role</em>       <br>        <strong> <em>- </em>arn:aws:iam::&lt;DevAccount&gt;:role/testrole</strong></pre><pre>}<br>If you interested to understand how token is generated follow along this link</pre><pre><a href="https://github.com/aws/aws-cli/blob/v2/awscli/customizations/eks/get_token.py">https://github.com/aws/aws-cli/blob/v2/awscli/customizations/eks/get_token.py</a></pre><p><strong>Modify Dev Cluster aws-auth config </strong>to map IAM role to K8s RBAC</p><p>(Follow<strong> </strong><a href="https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html">https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html</a></p><p>Wisely choose the role <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#default-roles-and-role-bindings">https://kubernetes.io/docs/reference/access-authn-authz/rbac/#default-roles-and-role-bindings</a>)</p><pre>data:<br> mapRoles: !<br>  &lt;existing roles&gt;<br> - rolearn: arn:aws:iam::&lt;DevAccount&gt;:role/testrole<br>   username: test #name does not matter<br>   groups:<br>    -system:masters</pre><p>Ensure that you have AWS cli and kubectl installed on the pod.</p><p><strong>Now access dev cluster from Shared services pod by using kubectl !</strong></p><p><strong>Note</strong></p><p>This was written when AWS documentation did not mention cross account use case. This article use “chained AssumeRole” mechanism as mentioned in the docs now.</p><p><a href="https://docs.aws.amazon.com/eks/latest/userguide/cross-account-access.html">https://docs.aws.amazon.com/eks/latest/userguide/cross-account-access.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3482f7c96d9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamically creating avro schema]]></title>
            <link>https://neeraj-agrawal.medium.com/dynamically-creating-avro-schema-86ac872b894a?source=rss-18903dd7c8fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/86ac872b894a</guid>
            <category><![CDATA[avro]]></category>
            <dc:creator><![CDATA[Neeraj Agrawal]]></dc:creator>
            <pubDate>Wed, 21 Oct 2020 19:32:11 GMT</pubDate>
            <atom:updated>2023-03-03T14:25:03.638Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently ran into a use case where I had to convert data coming in as a csv file to avro and the schema was defined in a business document.</p><p>Since avro needs a schema and there wasn’t expectation for business to provide .avsc file. Schema could evolve over time and maintenance of .avsc was yet another challenge. That led to design a system where schema would be defined in a generic way and would be fed into avro generator. Following is the approach:</p><p><strong>Create avro schema dynamically:</strong></p><pre>FieldAssembler&lt;Schema&gt; record = SchemaBuilder.<em>record</em>(&quot;name&quot;)<br>.namespace(&quot;org.data.test&quot;)<br>.fields();</pre><pre>//from columms defined elsewhere for the data.<br>List&lt;Columns&gt; columns =  getColumns()<br><strong>for</strong>( Columns  column : columns) {</pre><pre>   String fieldName = column.getName();<br>   String type = column.getType();</pre><pre><strong>   switch</strong> ( type ) {<br>        <strong>case</strong> <strong><em>STRING</em></strong>:<br>           record.requiredString(fieldName);<br>           <strong>break</strong>;</pre><pre><strong>        case</strong> <strong><em>INTEGER</em></strong>:<br>           record.requiredInt(fieldName);<br>           <strong>break</strong>;</pre><pre>        <strong>case</strong> <strong><em>BOOLEAN</em></strong>:<br>           record.requiredBoolean(fieldName);<br>           <strong>break</strong>;</pre><pre><strong>        case</strong> <strong><em>NUMERIC</em></strong>:<br>           record.requiredInt(fieldName);<br>           <strong>break</strong>;</pre><pre><strong>        case</strong> <strong><em>DATETIME</em></strong>:          <br>           record.name(fieldName)<br>           .type(LogicalTypes.<em>timestampMillis</em>()<br>           .addToSchema(Schema.<em>create</em>(Schema.Type.<strong><em>LONG</em></strong>)))<br>           .noDefault();<br>           <strong>break</strong>;</pre><pre><strong>        case</strong> <strong><em>DATE</em></strong>:      <br>           record.name(fieldName)<br>           .type(LogicalTypes.<em>date</em>()<br>           .addToSchema(Schema.<em>create</em>(Schema.Type.<strong><em>INT</em></strong>)))<br>           .noDefault();<br>           <strong>break</strong>;</pre><pre>      }</pre><pre>}<br>Schema schema = record.endRecord();</pre><p><strong>Handling of datetime</strong></p><pre><strong>In the schema I am declaring datetime as long and hence using this transformation in my avro generator</strong></pre><pre><strong>public</strong> <strong>long</strong> getDateTimeFromUTCLong(String time) <strong>throws</strong> ParseException {</pre><pre><strong>if</strong>( time != <strong>null</strong> &amp;&amp; time.length() &gt; 0 ) {</pre><pre>   SimpleDateFormat dateFormat = <strong>new</strong> SimpleDateFormat(&quot;yyyy-MM-dd    HH:mm:ss z&quot;);</pre><pre><strong>long</strong> longTime =  dateFormat.parse(time).getTime();<br><strong>return</strong> longTime;</pre><pre>}</pre><pre><strong>return</strong> 0;</pre><pre>}</pre><p>or Java 8 way</p><pre>DateTimeFormatter dtf = DateTimeFormatter.<em>ofPattern</em>(&quot;yyyy-MM-dd HH:mm:ss z&quot;);</pre><pre>Instant instant = Instant.<em>from</em>(dtf.parse(date));<br>return instant.getEpochSecond();</pre><p><strong>Now create an avro file while using the schema generated above</strong></p><pre>DatumWriter&lt;GenericRecord&gt; datumWriter = <strong>new</strong> GenericDatumWriter&lt;GenericRecord&gt;(schema);</pre><pre>DataFileWriter&lt;GenericRecord&gt; dataFileWriter = <strong>new</strong> DataFileWriter&lt;GenericRecord&gt;(datumWriter);</pre><pre>File file = <strong>new</strong> File(avroFileName);<br>dataFileWriter.create(schema, file);</pre><pre>GenericRecord row = <strong>new</strong> GenericData.Record(schema);</pre><pre>dataFileWriter.append(row);</pre><pre>...<br>dataFileWriter.close();</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86ac872b894a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cross account Secrets Access in AWS]]></title>
            <link>https://neeraj-agrawal.medium.com/cross-account-secrets-access-in-aws-8ef7978169db?source=rss-18903dd7c8fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ef7978169db</guid>
            <category><![CDATA[secrets]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Neeraj Agrawal]]></dc:creator>
            <pubDate>Wed, 21 Oct 2020 15:58:32 GMT</pubDate>
            <atom:updated>2024-09-06T13:23:46.951Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cross account Secrets Access in AWS EKS pod</h3><p>This covers a use case where you have several applications in an enterprise, and they are deployed in different AWS account based on environment such dev, int, prod. You also have a centralized security account which stores credentials for various dependent services an app needs.</p><p>The AWS secrets manager can hosts the secrets. You can create secrets with uri ‘s so as to distinguish between environments and have the application in a given environment only access the secret for that specific environment.</p><p>This is the mechanism which would help it achieve :</p><p><strong>Secret Hosting Account :</strong> grants permission to a role in the Accessing Account via trust relationship.</p><pre>Role : &quot;arn:aws:iam::&lt;Hosting Account&gt;:role/testsecrets-dev&quot;</pre><pre>Trust relationship<br>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Sid&quot;: &quot;1&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: {<br>        &quot;AWS&quot;: &quot;arn:aws:iam::&lt;Accessing Account&gt;:role/testsecrets-dev&quot;<br>      },<br>      &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>    }<br>  ]<br>}</pre><pre>Policy giving access to &quot;dev&quot; secrets only<br>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Sid&quot;: &quot;1&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: [<br>                &quot;kms:Decrypt&quot;,<br>                &quot;kms:DescribeKey&quot;,<br>                &quot;secretsmanager:GetSecretValue&quot;<br>            ],<br>            &quot;Resource&quot;: [<br>                &quot;arn:aws:secretsmanager:us-east-1:&lt;Hosting Account&gt;:secret:dev/testsecrets/*&quot;,<br>                &quot;arn:aws:kms:us-east-1:&lt;Hosting Account&gt;:key/*&quot;<br>            ]<br>        }<br>    ]<br>}</pre><p><strong>Accessing Account :</strong> seeks permission</p><pre>Role : &quot;arn:aws:iam::&lt;Accessing Account&gt;:role/testsecrets-dev&quot;</pre><pre>Policy</pre><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Sid&quot;: &quot;1&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Resource&quot;: &quot;arn:aws:iam::&lt;Hosting Account&gt;:role/testsecrets-dev&quot;,<br>            &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>        }<br>    ]<br>}</pre><p>Following IAM roles for service account pattern, ensure to define following Trust relationship.</p><pre>Trust relationship<br>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: {<br>        &quot;Federated&quot;: &quot;arn:aws:iam::&lt;Accessing Account&gt;:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/&lt;cluster id&gt;&quot;<br>      },<br>      &quot;Action&quot;: &quot;sts:AssumeRoleWithWebIdentity&quot;,<br>      &quot;Condition&quot;: {<br>        &quot;StringEquals&quot;: {<br>          &quot;oidc.eks.us-east-1.amazonaws.com/id/&lt;cluster id&gt;:sub&quot;: &quot;system:serviceaccount:&lt;eks ns&gt;:&lt;service account&gt;&quot;<br>        }<br>      }<br>    }<br>  ]<br>}</pre><p>Also set the role in the service account and deploy the application.</p><p>AWS injects above role in the pod as environment variable AWS_ROLE_ARN. The token file is also available from environment variable AWS_WEB_IDENTITY_TOKEN_FILE. Behind the scenes, EKS is using a <a href="https://github.com/aws/amazon-eks-pod-identity-webhook">Mutating Webhook</a> to mount an OIDC token ( ID token ) signed by the cluster into the pod through a <a href="https://kubernetes.io/docs/concepts/storage/projected-volumes/">volume projection</a>.</p><pre>String role_ARN = &quot;arn:aws:iam::&lt;Hosting Account&gt;:role/testsecrets-dev&quot;;</pre><pre>/*<br>In this code, AssumeRoleWithWebIdentity takes place behind the scenes by using role and the token from the environment variable. The mounted OIDC jwt token on the pod is exchanged to get AWS temporary credentials by STS Service, those credentials are then used to create instance of AWSSecurityTokenService to prepare for next assume role.<br>*/</pre><pre>AWSSecurityTokenService stsClient = AWSSecurityTokenServiceClientBuilder.standard()                .withCredentials(WebIdentityTokenCredentialsProvider.create()).withRegion(&quot;us-east-1&quot;).build();</pre><pre>AssumeRoleRequest roleRequest = new AssumeRoleRequest()                    .withRoleArn(role_ARN) <br>.withRoleSessionName(&quot;iam&quot;);  </pre><pre>/*<br>Now use AWSSecurityTokenService to assume role of hosting account and get new set of temporary credentials <br>*/</pre><pre>AssumeRoleResult roleResponse = stsClient.assumeRole(roleRequest);         Credentials credentials = roleResponse.getCredentials();</pre><pre>BasicSessionCredentials awsCredentials = new BasicSessionCredentials(credentials.getAccessKeyId(),                credentials.getSecretAccessKey(), credentials.getSessionToken());  </pre><pre>AWSSecretsManager client = AWSSecretsManagerClientBuilder.standard()                .withCredentials(new AWSStaticCredentialsProvider(awsCredentials))                .withRegion(&quot;us-east-1&quot;).build();</pre><pre>//now access the secret through client</pre><p>Note : This was written when AWS documentation did not mention cross account use case. This article uses “Chained AssumeRole” mechanism as mentioned in the docs now.</p><p>References</p><ul><li><a href="https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html">https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html</a></li><li><a href="https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html">https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html</a></li><li><a href="https://github.com/aws/amazon-eks-pod-identity-webhook">https://github.com/aws/amazon-eks-pod-identity-webhook</a></li><li>OIDC Session Principal at <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#sts-session-principals">https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#sts-session-principals</a></li><li><a href="https://docs.aws.amazon.com/cli/latest/reference/sts/assume-role-with-web-identity.html#examples">https://docs.aws.amazon.com/cli/latest/reference/sts/assume-role-with-web-identity.html#examples</a></li><li><a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#what-are-they">https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#what-are-they</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ef7978169db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[docker for mac]]></title>
            <link>https://neeraj-agrawal.medium.com/docker-for-mac-ca8eb2f36c00?source=rss-18903dd7c8fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca8eb2f36c00</guid>
            <dc:creator><![CDATA[Neeraj Agrawal]]></dc:creator>
            <pubDate>Sat, 11 Apr 2020 20:25:53 GMT</pubDate>
            <atom:updated>2023-04-21T17:05:04.055Z</atom:updated>
            <content:encoded><![CDATA[<h3>multi container in a pod and localhost lookup</h3><ul><li>Create a pod with 2 containers</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*5PsbACoIEc2urJ4ZpIKtHA.png" /></figure><ul><li>If you have docker for mac, go inside hyperkit</li><li>screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty</li><li>list all processes running ps -ef, find the ones which were started by your pod. In pod spec above the process id are 12913( nginx)and 12981 (the tail commad running in alpine )</li><li>List namespaces for each process id</li></ul><p>lsns -t net -o NS,TYPE,PATH,NPROCS,PID,PPID,COMMAND,UID,USER</p><ul><li>notice that processes have same namespace id for net and ipc, they are essentially in same “container” and hence localhost lookup is possible</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8MPC_sZxE513_PGLp38tRw.png" /></figure><p>References</p><ul><li>Linux namespace <a href="https://en.wikipedia.org/wiki/Linux_namespaces">https://en.wikipedia.org/wiki/Linux_namespaces</a></li><li><a href="https://en.wikipedia.org/wiki/LXC">https://en.wikipedia.org/wiki/LXC</a></li><li><a href="https://www.redhat.com/sysadmin/7-linux-namespaces">https://www.redhat.com/sysadmin/7-linux-namespaces</a></li><li><a href="https://lwn.net/Articles/199643/">https://lwn.net/Articles/199643/</a></li><li><a href="https://earthly.dev/blog/lxc-vs-docker/">https://earthly.dev/blog/lxc-vs-docker/</a></li><li><a href="https://www.nginx.com/blog/what-are-namespaces-cgroups-how-do-they-work/">What Are Namespaces and cgroups, and How Do They Work? — NGINX</a></li><li><a href="https://www.mirantis.com/blog/multi-container-pods-and-container-communication-in-kubernetes/">Kubernetes multi-container pods and container communication| Mirantis</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca8eb2f36c00" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TLS fundamentals]]></title>
            <link>https://neeraj-agrawal.medium.com/tls-fundamentals-86e524b48516?source=rss-18903dd7c8fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/86e524b48516</guid>
            <category><![CDATA[tls]]></category>
            <dc:creator><![CDATA[Neeraj Agrawal]]></dc:creator>
            <pubDate>Sat, 11 Apr 2020 20:15:02 GMT</pubDate>
            <atom:updated>2026-11-20T13:47:54.244Z</atom:updated>
            <content:encoded><![CDATA[<h3>TLS and certificates</h3><p>To ensure that communication between client and server happens securely, the data is encrypted when passed in the network.</p><p><strong>Fundamentals</strong></p><ul><li>Encryption: Converting Data into “gibberish”</li><li>Decryption : Getting original data from “gibberish”</li><li>Symmetric Key : Sender and receiver use same “key”, e.g. take ‘a’, get ascii value and 26, adding 26 is the key . Receiver does a reverse process to original data.</li><li>Asymmetric keys : Key is different for encryption and decryption but is related. Data is encrypted using <strong>public key</strong> and decrypted using <strong>private key</strong>. Idea is that, in theory you cannot derive private key from public. Public key is shared with others whereas private key remains on the server.</li><li>Certificate: some metadata about key pair and public key signed by an entity called Certification Authority (CA) . A certificate is normally assigned to one DNS name (like medium.com)</li><li>(root)CA : An entity that signs the certificate. Some CA’s are GoDaddy, Amazon, DigiCert</li><li>Private CA: entity that issues certificate for limited users, like an organization. For e.g, intranet apps which are not accessed in public domain don’t need to have certs signed by known root CAs. You would need to install cert in clients (such as browser or your JRE) so that you don’t get error similar to “this connection is not trusted”. Reason, browser comes pre installed with known root certs only, hence the error. The problem is often mitigated by your enterprise IT since they roll out computers with such certs pre installed.</li><li>Certificate chain: Root and intermediate CA’s. Essentially adds layer of security. Top level (root) cert is self signed by CA. In a typical cert, you would see. Root-&gt;Intermediate-&gt;Domain . Click on the padlock in the address bar of the browser you are reading this and notice the certificate.</li></ul><p><strong>Extensions Used</strong></p><ul><li>X 509 : is a certificate which is digitally signed according to RFC 5280, it has public key</li><li>.CER, .DER : binary DER encoded</li><li>PEM : Base 64 encoded ASCII with— BEGIN line. Often contains private key.</li><li>CRT : PEM file which has certificate only, does not have private key.</li><li>.KEY = The KEY extension is used both for public and private PKCS#8 keys. The keys may be encoded as binary DER or as ASCII PEM.</li></ul><p><strong>Enabling TLS on a website</strong></p><ul><li>Generate private key and Certificate Signing Request ( CSR ) . Consider CN (Common Name ) and SAN ( Subject Alternative Name )</li><li>Install private key on the server, typically a Load balancer. See an example <a href="https://nginx.org/en/docs/http/configuring_https_servers.html">Configuring HTTPS servers (nginx.org)</a></li><li>In k8s based microservice see <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#tls">Ingress | Kubernetes</a></li><li>Install root cert on a client(browser) if CA is not known.</li><li>Decide where to decrypt data. Typically at Load balancer.</li></ul><ol><li>SSL Termination : End point where data is decrypted</li><li>SSL passthrough: unencrypted data is passed to the web server by load balancer</li></ol><p><strong>How TLS communication is handled in browser</strong></p><ul><li>Browsers use various root certs — either installed on the OS or browser themselves ( typically Firefox )</li><li>During TLS handshake the domain/server presents the certificate to the browser</li><li>Note that you do not need to install a domain’s cert in your browser.</li><li>Together with root and intermediate cert the domain cert is validated. If the validation succeeds the TLS communication starts.</li></ul><p><strong>How TLS communication is handled in Java Apps</strong></p><ul><li>Trust store: The default trust store is at /jre/lib/security/cacerts and it comes with list of trusted root certificate. This is the location to put root and intermediate certs of web applications signed by private CA. The process to validate domain certificate is similar to the one covered for browser. On Redhat based distributions putting certs in /etc/pki/java/cacerts will be reflected in /jre/lib/security/cacerts. In Debian/ubuntu it is /etc/ssl/certs/java/cacerts</li><li>Key store : if you are a server, put private key in here. Won’t recommend this approach to secure the website. Better to use a proxy server. For web apps refer to Enabling TLS on a website section above.</li><li>Tip : If you are getting certificate errors for spring.io, gradle etc see it is referring to Zscaler cert, install Zscaler root and intermediate certificate in the trust store</li></ul><p><strong>Truststore/Certificate Location in OS</strong></p><p><strong>Ubuntu/Debian:</strong> /etc/ssl/certs</p><p>ubuntu/debian has a file named ca-certficates.crt under /etc/ssl/certs which is a concatenated list of certificates under that folder. To add a new certificate put it under <strong>/usr/local/share/ca-certificates</strong> and run <strong>update-ca-certificates</strong> command.</p><p><strong>RHEL:</strong> /etc/pki/ca-trust</p><p>RHEL has file named ca-bundle.crt under /etc/pki/tls/certs/. To add a new certificate place in <strong>/etc/pki/ca-trust/source/anchors/</strong> and run <strong>update-ca-trust</strong></p><p><strong>Command to read certs in a bundle</strong><br>openssl storeutl -noout -text -certs /etc/ssl/certs/ca-certificates.crt</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86e524b48516" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A quest to encrypt data in flight to the services deployed in Kubernetes.]]></title>
            <link>https://neeraj-agrawal.medium.com/a-quest-to-encrypt-data-in-flight-to-the-services-deployed-in-kubernetes-cc248bb5ab8e?source=rss-18903dd7c8fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc248bb5ab8e</guid>
            <dc:creator><![CDATA[Neeraj Agrawal]]></dc:creator>
            <pubDate>Sat, 11 Apr 2020 14:54:02 GMT</pubDate>
            <atom:updated>2023-04-07T13:30:44.405Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>End to end encryption to the services deployed in Kubernetes.</strong></h3><p>These are the few options which were explored for enabling End to end encryption of services deplpoyed on Kubernetes.</p><h4>AWS <strong>Application Load Balancer (ALB) Ingress Controller</strong></h4><ol><li>Does not support pass through implying that decryption and then encryption again will happen at the Load Balancer</li><li>Does not validate backend cert . Kevin Burke’s article. <a href="https://kevin.burke.dev/kevin/aws-alb-validation-tls-reply/">https://kevin.burke.dev/kevin/aws-alb-validation-tls-reply/</a></li><li>Each namespace provisions new load balancer, so the cost benefit is limited</li></ol><p>Follow this pattern for TLS between Load balancer to the service.</p><ul><li>Install certs on the application container. OR</li><li>Install cert on side car container such as nginx and use proxy_pass from nginx to redirect to application port. (To dump request on nginx use use client_body_in_file_only on, see body_filter_by_lua for response)</li></ul><p>Use following annotations on the ingress resource</p><p>alb.ingress.kubernetes.io/backend-protocol: https</p><p>alb.ingress.kubernetes.io/certificate-arn: &lt;certificate-arn&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RGP8q--b5Q7IL2gqjGPBIg.png" /></figure><p><strong>References :</strong></p><ul><li><a href="https://aws.amazon.com/blogs/opensource/kubernetes-ingress-aws-alb-ingress-controller/">Kubernetes Ingress with AWS ALB Ingress Controller | Amazon Web Services</a></li><li><a href="https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/">Using a Network Load Balancer with the NGINX Ingress Controller on Amazon EKS | Amazon Web Services</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc248bb5ab8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>