<?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 Tyler Lisowski on Medium]]></title>
        <description><![CDATA[Stories by Tyler Lisowski on Medium]]></description>
        <link>https://medium.com/@lisowski0925?source=rss-846da30431d8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*fK_Mvf5WgNNLrBgddeVqEw.jpeg</url>
            <title>Stories by Tyler Lisowski on Medium</title>
            <link>https://medium.com/@lisowski0925?source=rss-846da30431d8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 00:45:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lisowski0925/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[Demystifying Inferencing at Scale with LLM-D on Red Hat Openshift on IBM Cloud]]></title>
            <link>https://lisowski0925.medium.com/demystifying-inferencing-at-scale-with-llm-d-on-red-hat-openshift-on-ibm-cloud-3e0bf7596013?source=rss-846da30431d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e0bf7596013</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm-deployment]]></category>
            <category><![CDATA[llm-serving]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Tyler Lisowski]]></dc:creator>
            <pubDate>Sat, 31 May 2025 02:23:28 GMT</pubDate>
            <atom:updated>2025-05-31T02:27:02.381Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog illustrates how <a href="https://llm-d.ai/">llm-d</a>, running on IBM Cloud Red Hat Openshift, delivers cost-effective inferencing at scale of LLMs. The reader will gain insights into the key technologies that llm-d builds on to deliver a scalable inferencing solution and see how llm-d seamlessly integrates into existing AI toolsets like AnythingLLM. Going a level deeper: let’s look at how llm-d enables inferencing at scale through analyzing a deployment of llm-d on a IBM Cloud Red Hat Openshift Cluster running <a href="https://huggingface.co/ibm-granite/granite-3.3-8b-base">granite-3.3–8b-base</a> and <a href="https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct">llama-3–1–8b-instruct</a> models. We will dive into how each of the following llm-d innovations running on top of IBM Cloud Red Hat Openshift enable cost efficient high performance inferencing at scale:</p><p><strong>· VLLM: the open source de facto standard inference server<br>· Prefill and Decode Disaggregation<br>· KV (key-value) Cache Offloading, based on LMCache<br>· AI-Aware Network Routing</strong></p><h3>VLLM</h3><p>Let’s first start by looking at the model server backend powered by vllm of the live llama model and granite model:</p><p><em>Llama model</em></p><pre>$ kubectl get pods -n llama-3-1-8b-instruct<br>NAME                                            READY   STATUS      RESTARTS   AGE<br>llama-3-1-8b-instruct-decode-d56d75c57-ndr8v    2/2     Running     0          3h26m<br>llama-3-1-8b-instruct-epp-85484474d-wpqrl       1/1     Running     0          3h26m<br>llama-3-1-8b-instruct-prefill-5d9796c8c-mqvvk   1/1     Running     0          3h26m</pre><p><em>Granite Model</em></p><pre>$ kubectl get pods -n granite-3-3-8b-instruct<br>NAME                                           READY   STATUS      RESTARTS   AGE<br>granite-3-3-8b-instruct-decode-796dd6758d-zt57t    2/2     Running     0          12d<br>granite-3-3-8b-instruct-epp-597c886f78-jg5m5       1/1     Running     0          12d<br>granite-3-3-8b-instruct-prefill-54856c7898-vwb52   1/1     Running     0          12d</pre><p>A couple notes on the architecture: both the prefill and decode model server deployments are powered with vllm which can be seen by the startup logs of the containers in each of the pods:</p><pre>$ kubectl logs -n llama-3-1-8b-instruct  llama-3-1-8b-instruct-decode-d56d75c57-ndr8v<br>Defaulted container &quot;vllm&quot; out of: vllm, routing-proxy (init)<br>INFO 05-15 23:44:17 [__init__.py:239] Automatically detected platform cuda.<br>INFO 05-15 23:44:19 [api_server.py:1043] vLLM API server version 0.1.dev1+g7a1f25f<br>…<br>INFO 05-15 23:44:26 [config.py:713] This model supports multiple tasks: {&#39;reward&#39;, &#39;score&#39;, &#39;generate&#39;, &#39;embed&#39;, &#39;classify&#39;}. Defaulting to &#39;generate&#39;.</pre><pre>$ kubectl logs -n llama-3-1-8b-instruct  llama-3-1-8b-instruct-prefill-5d9796c8c-mqvvk<br>INFO 05-15 23:44:14 [__init__.py:239] Automatically detected platform cuda.<br>INFO 05-15 23:44:15 [api_server.py:1043] vLLM API server version 0.1.dev1+g7a1f25f<br>…<br>INFO 05-15 23:44:22 [config.py:713] This model supports multiple tasks: {&#39;generate&#39;, &#39;score&#39;, &#39;reward&#39;, &#39;embed&#39;, &#39;classify&#39;}. Defaulting to &#39;generate&#39;.</pre><p>VLLM employs state of the art memory management techniques and continuous batch request processing strategies to enable fast model response times while efficiently using the hardware/accelerators it runs on top of. In some published calculations: vLLM achieves up to <a href="https://www.redhat.com/en/topics/ai/what-is-vllm">24x higher</a> throughput compared to other popular model serving libraries. The efficiency and performance make it a perfect choice for powering environments serving large scales of requests across multiple models.</p><h3>Prefill and Decode Disaggregation</h3><p>When looking at the live deployment of the llama model: notice there are two independent pods distributed across the cluster working together in a peer to peer fashion: the decode llama model pod and the prefill llama model pod. Enabling dedicated pools of workload to execute the prefill workflow and decode workflow in inferencing enables employing different parallel processing strategies in the precode phase of inferencing and the decode phase of inferencing. Beyond strategies: precode and decode workload for a given model can be ran on separate machines tailored to processing that step of the overall inferencing process. Ultimately: this deployment strategy results in faster time to first token and faster inter token latencies whereas in typical single instance deployments complex tradeoffs typically have to be considered between the two targets.</p><h3>KV (key-value) Cache Offloading, based on LMCache</h3><p>Within the model deployment as well: LMCache is utilized to form a distributed KV cache solution that is able to distribute segments of the KV cache across redis and members of the prefill and decode running the model enabling efficient utilization of all accelerator memory across the cluster. Additionally: these processes can be seen running within VLLM in the logs of the decode and prefill pods:</p><pre>$ kubectl logs -n llama-3-1-8b-instruct  llama-3-1-8b-instruct-prefill-5d9796c8c-mqvvk | grep lmcache<br>[2025-05-15 23:44:31,318] LMCache INFO: Loading LMCache config file /vllm-workspace/lmcache-prefiller-config.yaml (utils.py:32:lmcache.integration.vllm.utils)<br>[2025-05-15 23:44:31,321] LMCache INFO: Creating LMCacheEngine instance vllm-instance (cache_engine.py:467:lmcache.experimental.cache_engine)<br>[2025-05-15 23:44:31,322] LMCache INFO: Creating LMCacheEngine with config: LMCacheEngineConfig(chunk_size=256, local_cpu=False, max_local_cpu_size=0, local_disk=None, max_local_disk_size=0, remote_url=None, remote_serde=None, save_decode_cache=False, enable_blending=False, blend_recompute_ratio=0.15, blend_min_tokens=256, blend_special_str=&#39; # # &#39;, enable_p2p=False, lookup_url=None, distributed_url=None, error_handling=False, enable_controller=False, lmcache_instance_id=&#39;lmcache_default_instance&#39;, controller_url=None, lmcache_worker_url=None, enable_nixl=True, nixl_role=&#39;sender&#39;, nixl_peer_host=&#39;llama-3-1-8b-instruct-service-decode.llama-3-1-8b-instruct.svc.cluster.local&#39;, nixl_peer_port=55555, nixl_buffer_size=524288, nixl_buffer_device=&#39;cuda&#39;, nixl_enable_gc=True) (cache_engine.py:73:lmcache.experimental.cache_engine)<br>[2025-05-15 23:44:35,435] LMCache INFO: Received remote transfer descriptors (nixl_connector_v2.py:212:lmcache.experimental.storage_backend.connector.nixl_connector_v2)<br>[2025-05-15 23:44:35,435] LMCache INFO: Initializing usage context. (usage_context.py:235:lmcache.usage_context)</pre><pre>$ kubectl logs -n llama-3-1-8b-instruct llama-3-1-8b-instruct-decode-d56d75c57-ndr8v | grep lmcache<br>[2025-05-15 23:44:35,277] LMCache INFO: Loading LMCache config file /vllm-workspace/lmcache-decoder-config.yaml (utils.py:32:lmcache.integration.vllm.utils)<br>[2025-05-15 23:44:35,280] LMCache INFO: Creating LMCacheEngine instance vllm-instance (cache_engine.py:467:lmcache.experimental.cache_engine)<br>[2025-05-15 23:44:35,280] LMCache INFO: Creating LMCacheEngine with config: LMCacheEngineConfig(chunk_size=256, local_cpu=False, max_local_cpu_size=0, local_disk=None, max_local_disk_size=0, remote_url=None, remote_serde=None, save_decode_cache=False, enable_blending=False, blend_recompute_ratio=0.15, blend_min_tokens=256, blend_special_str=&#39; # # &#39;, enable_p2p=False, lookup_url=None, distributed_url=None, error_handling=False, enable_controller=False, lmcache_instance_id=&#39;lmcache_default_instance&#39;, controller_url=None, lmcache_worker_url=None, enable_nixl=True, nixl_role=&#39;receiver&#39;, nixl_peer_host=&#39;0.0.0.0&#39;, nixl_peer_port=55555, nixl_buffer_size=524288, nixl_buffer_device=&#39;cuda&#39;, nixl_enable_gc=True) (cache_engine.py:73:lmcache.experimental.cache_engine)<br>[2025-05-15 23:44:35,429] LMCache INFO: Sent local transfer descriptors to sender (nixl_connector_v2.py:223:lmcache.experimental.storage_backend.connector.nixl_connector_v2)<br>[2025-05-15 23:44:35,430] LMCache INFO: Initializing usage context. (usage_context.py:235:lmcache.usage_context)</pre><p>IBM Cloud VPC’s highly performant unmetered private network backbone in combination with the NVIDIA NIXL library ensures fast and secure communications between peer to peer pods and redis further enhancing overall throughput and inference latencies.</p><h3>AI Aware Network Routing</h3><p>To optimally route requests across the distributed model network: llm-d employs controllers built on top of the <a href="https://gateway-api-inference-extension.sigs.k8s.io/">gateway api inference extension</a> to handle intelligently routing requests to the appropriate prefill or decode model pod that contains the hottest KV cache to ensure efficient request processing. The core pieces of this system consist of a inference API gateway and a model endpoint picker. These pods are shown below along with the load balancer associated with the inference API gateway:</p><pre>$ kubectl get service -n llm-d inference-gateway<br>NAME                TYPE           CLUSTER-IP      EXTERNAL-IP                           PORT(S)         AGE<br>inference-gateway   LoadBalancer   172.21.237.63   89ab7fc6-us-east.lb.appdomain.cloud   443:31297/TCP   14d<br><br><br>$ kubectl get pods -n llm-d -l app.kubernetes.io/instance=inference-gateway<br>NAME                                 READY   STATUS    RESTARTS   AGE<br>inference-gateway-74c676f884-4dcpf   1/1     Running   0          12d<br><br><br>$ kubectl get pods -n llama-3-1-8b-instruct | grep llama-3-1-8b-instruct-epp<br>llama-3-1-8b-instruct-epp-85484474d-wpqrl       1/1     Running     0          3h15m</pre><p>The endpoint picker (epp) is continuously monitoring the state of the distributed model deployment along with KV cache metrics associated with each instance in the deployment. The inference api gateway when it has a request sends metadata about the request to the epp pod which determines the optimal model instance in the decode or prefill pool to process the request. This intelligent routing system helps keep overall request latency down, throughput high, and avoid resource spikes with vllm instances that potentially degrade serving requests for the llama model.</p><h3>Inferencing with Deployed Models</h3><p>Now that we have done a dive into the backend architecture by looking at a live deployment of a llama model: let’s show how we can inference with both the granite and the llama model running in the same cluster. We will interact with both models through curl requests and using the popular LLM chat provider: AnythingLLM. With the following curl request we will ask the llama model the question of:</p><p><em>“Do you enjoy reading technical blog posts of state of the art AI solutions?”</em></p><p>and receive the answer:</p><p><em>“I can process and analyze technical blog posts about state-of-the-art AI solutions. I don’t have personal preferences or emotions, but I can provide information and insights about various AI technologies.</em></p><p><em>If you’re interested in discussing or summarizing technical blog posts about AI, I’d be happy to help. Please share the title or a brief summary of the blog post, and I’ll do my best to provide a summary, analysis, or insights about the topic.”</em></p><pre>cat &gt;&quot;/tmp/payload.json&quot; &lt;&lt;EOF<br>{<br>   &quot;model&quot;: &quot;Llama-3.1-8B-Instruct&quot;,<br>   &quot;messages&quot;: [<br>    {<br>      &quot;role&quot;: &quot;user&quot;,<br>      &quot;content&quot;: &quot;Do you enjoy reading technical blog posts of state of the art AI solutions?&quot;<br>    }<br>   ]<br>}<br>EOF<br><br>curl  -H &quot;Content-Type: application/json&quot; -H &quot;Authorization: Bearer API_KEY&quot; -X POST https://llama-3-1-8b-instruct.vllmd-test-cluster-80d128fecd199542426020c17e5e9430-0002.us-east.containers.appdomain.cloud/v1/chat/completions -d @/tmp/payload.json<br><br>{&quot;choices&quot;:[{&quot;finish_reason&quot;:&quot;stop&quot;,&quot;index&quot;:0,&quot;logprobs&quot;:null,&quot;message&quot;:{&quot;content&quot;:&quot;I can process and analyze technical blog posts about state-of-the-art AI solutions. I don&#39;t have personal preferences or emotions, but I can provide information and insights about various AI technologies.\n\nIf you&#39;re interested in discussing or summarizing technical blog posts about AI, I&#39;d be happy to help. Please share the title or a brief summary of the blog post, and I&#39;ll do my best to provide a summary, analysis, or insights about the topic.&quot;,&quot;reasoning_content&quot;:null,&quot;role&quot;:&quot;assistant&quot;,&quot;tool_calls&quot;:[]},&quot;stop_reason&quot;:null}],&quot;created&quot;:1747365656,&quot;id&quot;:&quot;chatcmpl-a1bd676c-3867-40ad-beb9-8c4f2b81952a&quot;,&quot;model&quot;:&quot;Llama-3.1-8B-Instruct&quot;,&quot;object&quot;:&quot;chat.completion&quot;,&quot;prompt_logprobs&quot;:null,&quot;usage&quot;:{&quot;completion_tokens&quot;:92,&quot;prompt_tokens&quot;:52,&quot;prompt_tokens_details&quot;:null,&quot;total_tokens&quot;:144}}</pre><p>The same question asked to the granite model receives the following response:</p><p><em>“While I don’t have personal feelings, I can certainly help you find and summarize information on state-of-the-art AI solutions from technical blog posts. I can provide insights, compare different approaches, and explain complex concepts in simpler terms.”</em></p><pre>cat &gt;&quot;/tmp/payload.json&quot; &lt;&lt;EOF<br>{<br>   &quot;model&quot;: &quot;granite-3.3-8b-instruct&quot;,<br>   &quot;messages&quot;: [<br>    {<br>      &quot;role&quot;: &quot;user&quot;,<br>      &quot;content&quot;: &quot;Do you enjoy reading technical blog posts of state of the art AI solutions?&quot;<br>    }<br>   ]<br>}<br>EOF<br><br>curl  -H &quot;Content-Type: application/json&quot; -H &quot;Authorization: Bearer API_KEY&quot; -X POST https://granite-3-3-8b-instruct.vllmd-test-cluster-80d128fecd199542426020c17e5e9430-0001.us-east.containers.appdomain.cloud/v1/chat/completions -d @/tmp/payload.json<br><br>{&quot;choices&quot;:[{&quot;finish_reason&quot;:&quot;stop&quot;,&quot;index&quot;:0,&quot;logprobs&quot;:null,&quot;message&quot;:{&quot;content&quot;:&quot;While I don&#39;t have personal feelings, I can certainly help you find and summarize information on state-of-the-art AI solutions from technical blog posts. I can provide insights, compare different approaches, and explain complex concepts in simpler terms.&quot;,&quot;reasoning_content&quot;:null,&quot;role&quot;:&quot;assistant&quot;,&quot;tool_calls&quot;:[]},&quot;stop_reason&quot;:null}],&quot;created&quot;:1747365786,&quot;id&quot;:&quot;chatcmpl-fbd2df65-0cb4-4b5e-aa2d-b35fce710354&quot;,&quot;model&quot;:&quot;granite-3.3-8b-instruct&quot;,&quot;object&quot;:&quot;chat.completion&quot;,&quot;prompt_logprobs&quot;:null,&quot;usage&quot;:{&quot;completion_tokens&quot;:51,&quot;prompt_tokens&quot;:76,&quot;prompt_tokens_details&quot;:null,&quot;total_tokens&quot;:127}}</pre><p>Now that we have successfully sent requests to both models with curl: let’s show how AnythingLLM can provide a chat UI interface with deployed llm-d models! First: we will create a new workspace in AnythingLLM called <em>llm-d-llama-3–1–8b-instruct</em>. Then we will go to settings of that workspace, then chat settings and then under workspace LLM Provider select “Generic OpenAI” provider. We then enter the following information for the base llama model. Note that the urls and generated apikeys will vary for every cluster and model deployment. This guide shows examples from a temporary test environment.</p><pre>Base URL: https://llama-3-1-8b-instruct.vllmd-test-cluster-80d128fecd199542426020c17e5e9430-0002.us-east.containers.appdomain.cloud/v1<br>API Key: &lt;API_KEY_GENERATED_FOR_MODEL&gt;<br>Chat Model Name: Llama-3.1-8B-Instruct<br>Token context window: 131072<br>Max Tokens: 1024</pre><p>Then click Save Settings. With that done we can now ask the same question and get a similar response from the model in the AnythingLLM UI (screenshot shown below):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aNl-KK2t7wSpDf28aGBmoA.png" /></figure><p>We will follow the same steps with a new granite-3–3–8b-instruct workspace with the following parameters</p><pre>Base URL: https://granite-3-3-8b-instruct.vllmd-test-cluster-80d128fecd199542426020c17e5e9430-0001.us-east.containers.appdomain.cloud/v1<br>API Key: &lt;API_KEY_GENERATED_FOR_MODEL&gt;<br>Chat Model Name: granite-3.3-8b-instruct<br>Token context window: 131072<br>Max Tokens: 1024</pre><p>We will see after initializing the workspace that the granite model will send a similar response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YW70Q5yCaX2btHyqk1VtfQ.png" /></figure><h3>Conclusion</h3><p>We have walked through the internals of how llm-d enables high scale efficient inferencing for multiple models by examining a deployment of it on IBM Cloud Red Hat Openshift. IBM is excited to continue to work with community to publish further specific performance metrics and benchmarks showing the power of llm-d within IBM Cloud. A video of the same content written about in this blog is available <a href="https://www.youtube.com/watch?v=UHiO50-EK7w">here</a>. Our next blog will dive into the specific steps to deploy llm-d within a Red Hat Openshift on IBM Cloud Cluster.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e0bf7596013" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s the Difference between Knowledge and Skills in Instructlab?]]></title>
            <link>https://lisowski0925.medium.com/whats-the-difference-between-knowledge-and-skills-in-instructlab-214f280175c8?source=rss-846da30431d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/214f280175c8</guid>
            <category><![CDATA[fine-tuning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Tyler Lisowski]]></dc:creator>
            <pubDate>Wed, 26 Mar 2025 01:28:58 GMT</pubDate>
            <atom:updated>2025-03-26T01:28:58.219Z</atom:updated>
            <content:encoded><![CDATA[<p>A common question that comes up when working with Instructlab taxonomies is when to classify a subject as knowledge or a skill in a taxonomy. In this article: I will give guidance on how to approach conceptualizing a use case in these terms and support that with details on how Instructlab processes these in the SDG process.</p><p>First a high level analogy when reading an example of a knowledge leaf node section: a good way to think about creating knowledge in a taxonomy is: I can ask and answer the following <strong><em>question_and_answers </em></strong>after reading the<strong><em> context </em></strong>in a given seed example.</p><pre>seed_examples:<br>  - context: &quot;Super Bowl LVIII was an American football game played to determine the champion of the National Football League (NFL) for the 2023 season. In a rematch of Super Bowl LIV from four years earlier, the American Football Conference (AFC) champion and defending Super Bowl champion Kansas City Chiefs defeated the National Football Conference (NFC) champion San Francisco 49ers 25–22 in overtime. The Chiefs became the first team to win back-to-back Super Bowls since the 2004 New England Patriots.&quot;<br>    questions_and_answers:<br>      - question: Who played in Superbowl LVIII?<br>        answer: The Kansas City Chiefs and the San Francisco 49ers.<br>      - question: Who won Superbowl LVIII?<br>        answer: The Kansas City Chiefs.<br>      - question: What was the final score of Superbowl LVIII?<br>        answer: The final score of Superbowl LVIII was 25 - 22, Chiefs.</pre><p>The <strong><em>context </em></strong>comes from a excerpt of a factual document that is referenced at the bottom of the taxonomy in the documents section. The excerpt should contain all the necessary information to answer the questions associated with the excerpt and not be isolated/modified to draw inconsistent conclusions from the overall document.</p><pre>document:<br>  repo: https://github.com/relyt0925/superbowl58-knowledge.git<br>  commit: 7536fdd769dcd85dbd1654926b6358122c919dc5<br>  patterns:<br>    - superbowl58.md</pre><p>In comparison: the way to think about grounded skills are given the example scenario/artifact in <strong><em>context</em></strong>: I can ask the following <strong><em>questions </em></strong>and answer with the following <strong><em>answers</em></strong></p><pre>seed_examples:<br>- context: |-<br>    **Alice:** Alright, everyone, welcome to our quarterly marketing team meeting. I&#39;d like to start with some quick introductions for our new team members, Emily and Daniel. Emily, Daniel, can you introduce yourselves?<br><br>    **Emily:** Hello, I&#39;m Emily, the new social media manager. I&#39;m excited to join the team and contribute to our social media strategy.<br><br>    **Daniel:** Hi, I&#39;m Daniel, the new content strategist. I&#39;m looking forward to working with everyone to create engaging content that resonates with our audience.<br><br>    **Alice:** Great, thank you for introducing yourselves. Please reach out to John after the meeting to get access to data. Now, let&#39;s move on to our agenda. First, we&#39;ll review Q1 performance. Sarah, can you give us an overview of how we did in the first quarter?<br><br>    **Sarah:** Sure, in Q1, we saw a 15% increase in website traffic, and a 12% growth in lead generation. We noticed some gaps in social media engagement that should be investigated. Our email campaigns performed well, with a 17% open rate and a 10% click-through rate. Overall, it was a strong start to the year.<br><br>    **Alice:** Thank you Sarah for sharing those numbers with us. Next, let&#39;s discuss campaign performance analysis. John, can you walk us through the insights you gathered from our recent campaigns?<br><br>    **John:** Absolutely. Our most recent campaign, the &quot;Spring into Savings&quot; promotion, had a 25% conversion rate, which is higher than our average of 15%. We also saw a significant increase in sales from our email campaigns, with a 30% open rate and a 20% click-through rate.<br><br>    **Alice:** Excellent job, John. It&#39;s great to see that our campaigns are resonating with our audience. Now, let&#39;s discuss upcoming campaigns. We have two major campaigns planned for Q2: the &quot;Summer Fun&quot; promotion and the &quot;Back-to-School&quot; campaign. Can we hear from the team leads on these campaigns?<br><br>    **Jane:** Yes, for the &quot;Summer Fun&quot; promotion, we&#39;re planning to create a series of engaging, summer-themed content, such as DIY projects, recipes, and travel tips. We could use some assistance in finding contractors. Our goal is to increase brand awareness and drive sales during the summer months.<br><br>    **Alice:** That sounds like a fun campaign. Thanks for the update, Jane. Any thoughts on the &quot;Back-to-School&quot; campaign?<br><br>    **Mike:** For the &quot;Back-to-School&quot; campaign, we&#39;re planning to focus on providing parents with useful tips and resources for preparing their children for the new school year. We are somewhat unsure of the best pricing strategy presently, but we&#39;d like to offer exclusive discounts on our products to help families save money during this time, if possible.<br><br>    **Alice:** Thank you, Jane and Mike, for sharing your plans with us. It&#39;s great to see the team working together to create engaging campaigns that meet our goals. Now, let&#39;s hear from the rest of the team for any updates or suggestions.<br><br>    **Rachel:** I&#39;ve been working on refining our email marketing strategy, and I think we could see even better results if we segment our email lists more effectively and tailor our content to each audience segment.<br><br>    **Alice:** That&#39;s a great suggestion, Rachel. We&#39;ll discuss this further in our next email marketing strategy session. Any other updates or suggestions before we wrap up?<br><br>    **Alice:** Alright, it seems like we have a solid plan in place for Q2. Let&#39;s move on to action items and next steps. I&#39;d like to remind everyone to stay focused on our goals and work together to ensure our campaigns are successful. Thank you all for your time today. Have a great day, everyone!<br>  question: &gt;-<br>    In the given meeting transcript, what are the unresolved items that will require further action from someone?<br>  answer: |-<br>    The unresolved items that will require further action from someone include:<br><br>    1. Emily and Daniel need to reach out to John after the meeting to get access to data.<br>    2. The team needs to investigate gaps in social media engagement.<br>    3. The team needs to find contractors to assist with the &quot;Summer Fun&quot; promotion.<br>    4. The team is unsure about the best pricing strategy for the &quot;Back-to-School&quot; campaign.<br>    5. Rachel&#39;s refinement of the email marketing strategy needs to be discussed further in the next email marketing strategy session.<br><br></pre><p>The key difference in a grounded skill from knowledge: is the context is an <strong><em>example that provides a basis to generate more example scenarios and is not a excerpt from a factual document. </em></strong>The impact of this key point becomes more clear when you look at the teacher model prompts for compositional skills specifically: <a href="https://github.com/instructlab/sdg/blob/main/src/instructlab/sdg/configs/skills/contexts.yaml">https://github.com/instructlab/sdg/blob/main/src/instructlab/sdg/configs/skills/contexts.yaml</a>. Notice how the context is read from the seed_example and feed into a prompt to a teacher model that then is utilized to generate more examples/artifacts from the seed_example:</p><pre>Now generate a context paragraph, remember to follow the principles mentioned above and use the same format as the examples. Remember to use the same style and format as the example above. Start your response with the tag [Start of Context] and end it with the tag [End of Context]</pre><p>Lastly: the final type of skill is a freeform skill. The format of that is below:</p><pre>seed_examples:<br>  - answer: &#39;Synonym for Attend is take part in<br><br>      &#39;<br>    question: List a synonym for the word attend.<br>  - answer: &#39;Two synonyms for Attend are<br><br>      take part in<br><br>      be present at<br><br>      &#39;<br>    question: List two synonyms for the word attend and separate with newline.</pre><p>The full information necessary to generate an answer is in the question (no need for a separate example/artifact to needing to be analyzed to provide the basis for answering the question and answer pairs).</p><h3>Use Cases For Knowledge</h3><p>Below are some of the key use cases for Instructlab that fit well into a knowledge leaf node</p><ol><li>Consolidated Financial Statements for a corporation</li><li>Analysis of Website Data</li><li>FAQs from historical customer call logs</li><li>Analysis of Plan Data</li><li>Tagging sensitive data from legal documents</li></ol><h3>Use Cases For Grounded Skills</h3><p>Below are some use cases for Instructlab that fit well into a grounded skills leaf node:</p><ol><li>Link Citation Formatting (MLA, etc)</li><li>Table of contents/agenda generation</li></ol><h3>Use Cases For Freeform Skills</h3><p>Below are some use cases for Instructlab that fit well into a freeform skills leaf node:</p><ol><li>Data masking of individual log lines</li></ol><p>In a next article I will build on this with tangible taxonomy examples utilizing the IBM Cloud Instructlab Service to produce fine tuned models that show the value of fine tuning a base model.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=214f280175c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Industry Best Practice Architectures: Government IBM Cloud Satellite Deployments]]></title>
            <link>https://lisowski0925.medium.com/industry-best-practice-architectures-government-ibm-cloud-satellite-deployments-ac9a0a6fe5ea?source=rss-846da30431d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac9a0a6fe5ea</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[compliance]]></category>
            <category><![CDATA[hybrid-cloud]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Tyler Lisowski]]></dc:creator>
            <pubDate>Mon, 13 Nov 2023 03:06:47 GMT</pubDate>
            <atom:updated>2023-11-13T03:06:47.297Z</atom:updated>
            <content:encoded><![CDATA[<p>This article outlines best practices I have encountered in my experiences with IBM Cloud Satellite deployments in the government space. The best practice architecture targets deployments into regulated on-premise datacenters. The article will start with outlining the architecture and then will walk through how the individual pieces of the architecture setup a robust environment for on-premise regulated applications in the government space. A live example deployment of the architecture in an on-premise data will be used to visualize the concepts.</p><p><strong>Architecture</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S9py0uNUBNe_rX7dlQaWMw.png" /><figcaption>Best Practice Architecture for Regulated Government Applications in IBM Cloud Satellite</figcaption></figure><p>The overall architecture consists of a three tier application (presentation, application, database) deployed in a IBM Cloud Red Hat Openshift cluster in a Satellite location within a regulated on-prem datacenter. In this design: the presentation tier has a basic webpage that displays content fetched from an API in the application tier. The application tier connects to the database tier to determine the content to display. Let’s now walk through the request flow starting from the consumer of the three tier application outside the regulated datacenter.</p><p><strong>Client -&gt; Load balancer (Openshift Router)</strong></p><p>The consumer accesses either the presentation tier or the application tier components through the openshift router. The traffic is sent to the openshift router through the clusters ingress subdomain. The ingress subdomain DNS maps to a select number of edge worker nodes in the cluster as shown below:</p><pre>ibmcloud ks ingress domain ls --cluster ckrdnalr0psd72bt16sg<br>OK<br>Domain                                                                                          Target(s)                     Default   Provider   Secret Status   Status<br>tyler-cloudpak-2-d-31-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud   <strong>10.240.64.127,10.240.64.128</strong>   yes       akamai     created         OK<br><br>bx cs workers --cluster ckrdnalr0psd72bt16sg<br>OK<br>ID                                                        Primary IP      Flavor   State    Status   Zone       Version<br>sat-testkernel-89ec105ae2017b89f0c4e99a6a6ce99ea4f39422   <strong>10.240.64.128</strong>   upi      normal   Ready    ca-tor-1   4.12.39_1566_openshift*<br>sat-testkernel-9e169a7699426944ca96412868028f52edeb3915   <strong>10.240.64.127</strong>   upi      normal   Ready    ca-tor-1   4.12.39_1566_openshift*<br>sat-tylercloud-e9c71b82531577a8870e27fc38179ee3145550e4   10.240.128.28   upi      normal   Ready    ca-tor-1   4.12.39_1566_openshift*<br>sat-tylercloud-f9e597828a5a63c24e69191f9c9f3591c3084b20   10.240.128.29   upi      normal   Ready    ca-tor-1   4.12.39_1566_openshift*<br>sat-tylercloud-fcfc202ff688f7d63c89adfcddd56cd3df93ea73   10.240.128.27   upi      normal   Ready    ca-tor-1   4.12.39_1566_openshift*<br><br>* To update to 4.12.41_1567_openshift version, run &#39;ibmcloud ks worker replace&#39;. Review and make any required version changes before you update: &#39;https://ibm.biz/upworker</pre><p>Once the traffic reaches the edge worker nodes: policy is placed in the cluster to restrict ingress access as appropriate in the environment. In our solution: all our external components in the presentation and application tier are going to be HTTPS apps only. Therefore we are only going to allow port 443 to ingress into the cluster from the outside the cluster. This is implemented in a calico policy shown below:</p><pre>- apiVersion: projectcalico.org/v3<br>  kind: GlobalNetworkPolicy<br>  metadata:<br>    name: allow-local-ingress-odf<br>  spec:<br>    applyOnForward: true<br>    ingress:<br>      - action: Allow<br>        source:<br>          selector: ibm.role == &#39;satellite_controller_worker&#39;<br>    order: 1400<br>    preDNAT: true<br>    selector: ibm-cloud.kubernetes.io/worker-pool-name == &#39;odf&#39;<br>    types:<br>      - Ingress<br>- apiVersion: projectcalico.org/v3<br>  kind: GlobalNetworkPolicy<br>  metadata:<br>    name: allow-local-ingress-edge<br>  spec:<br>    applyOnForward: true<br>    ingress:<br>      - action: Allow<br>        source:<br>          selector: ibm.role == &#39;satellite_controller_worker&#39;<br>      - action: Allow<br>        destination:<br>          nets:<br>            - 0.0.0.0/0<br>          ports:<br>            - 443<br>        protocol: TCP<br>        source: { }<br>    order: 1400<br>    preDNAT: true<br>    selector: ibm-cloud.kubernetes.io/worker-pool-name == &#39;edge&#39;<br>    types:<br>      - Ingress<br>- apiVersion: projectcalico.org/v3<br>  kind: GlobalNetworkPolicy<br>  metadata:<br>    name: deny-ingress-public-inbound<br>  spec:<br>    applyOnForward: true<br>    ingress:<br>      - action: Deny<br>        destination: {}<br>        source: {}<br>    order: 1500<br>    preDNAT: true<br>    selector: ibm.role == &#39;satellite_controller_worker&#39;<br>    types:<br>      - Ingress</pre><p>With this policy in place: we can see we can only send traffic on 443 through the edge nodes (which will then forward to the Openshift router for processing). The example below shows how traffic is blocked on port 80 (HTTP) but allowed on port 443.</p><pre>$ kubectl get route -n presentation-tier<br>NAME                    HOST/PORT                                                                                                                               PATH   SERVICES                PORT    TERMINATION   WILDCARD<br>presentation-tier-app   presentation-tier-app-presentation-tier.tyler-cloudpak-2-d-31-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud          presentation-tier-app   &lt;all&gt;   reencrypt     None<br><br>$ curl --connect-timeout 2 http://presentation-tier-app-presentation-tier.tyler-cloudpak-2-d-31-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud <br>curl: (28) Failed to connect to presentation-tier-app-presentation-tier.tyler-cloudpak-2-d-31-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud port 80 after 2005 ms: Timeout was reached<br><br>$ curl --connect-timeout 2 https://presentation-tier-app-presentation-tier.tyler-cloudpak-2-d-31-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud <br><br>&lt;!DOCTYPE html&gt;<br>...</pre><p>The policy allows all external IPs to access port 443 but note that can be restricted to specific known external client IP ranges by changing the 0.0.0.0/0 section of the calico policy. The additional `satellite_controller_worker` allow rule ensures ingress traffic from all intra cluster nodes is allowed which is required for general operations of the environment (all nodes in the same cluster should have full IP connectivity between one another). Note that this load balancing and ingress firewall functionality was able to be utilized within the environment without any specialized hardware (just regular available compute). Additionally: the firewall policy is distributed across cluster nodes resulting in no single point of failure along with a scalable firewall solution (just add more nodes to the edge worker pool) versus various legacy deployments with a set device that firewalls the entire environment (and is a single point of failure). We assume all external traffic is exposed over HTTPS but this pattern can be adjusted for different types of traffic on different ports as well (although that will not be covered in this guide).</p><p><strong>Openshift Router -&gt; Presentation Tier</strong></p><p>After the traffic reaches the openshift router: the openshift router will use route configuration to forward the traffic to the appropriate backend microservice. The configuration in a example environment is shown below:</p><pre>apiVersion: route.openshift.io/v1<br>kind: Route<br>metadata:<br>  annotations:<br>    kubectl.kubernetes.io/last-applied-configuration: |<br>      {&quot;apiVersion&quot;:&quot;route.openshift.io/v1&quot;,&quot;kind&quot;:&quot;Route&quot;,&quot;metadata&quot;:{&quot;annotations&quot;:{},&quot;name&quot;:&quot;presentation-tier-app&quot;,&quot;namespace&quot;:&quot;presentation-tier&quot;},&quot;spec&quot;:{&quot;tls&quot;:{&quot;termination&quot;:&quot;Reencrypt&quot;},&quot;to&quot;:{&quot;kind&quot;:&quot;Service&quot;,&quot;name&quot;:&quot;presentation-tier-app&quot;}}}<br>    openshift.io/host.generated: &quot;true&quot;<br>  creationTimestamp: &quot;2023-10-31T17:31:47Z&quot;<br>  name: presentation-tier-app<br>  namespace: presentation-tier<br>  resourceVersion: &quot;3262922&quot;<br>  uid: ca3b09ac-bb85-4fda-ab53-0a52b07c16f7<br>spec:<br>  host: presentation-tier-app-presentation-tier.tyler-cloudpak-2-d-31-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud<br>  tls:<br>    termination: reencrypt<br>  to:<br>    kind: Service<br>    name: presentation-tier-app<br>    weight: 100<br>  wildcardPolicy: None<br>status:<br>  ingress:<br>  - conditions:<br>    - lastTransitionTime: &quot;2023-10-31T17:31:47Z&quot;<br>      status: &quot;True&quot;<br>      type: Admitted<br>    host: presentation-tier-app-presentation-tier.tyler-cloudpak-2-d-31-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud<br>    routerCanonicalHostname: router-default.tyler-cloudpak-2-d-31-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud<br>    routerName: default<br>    wildcardPolicy: None</pre><pre>kubectl get pods -n openshift-ingress<br>NAME                              READY   STATUS    RESTARTS   AGE<br>router-default-6b9786dcbb-59958   1/1     Running   0          17d<br>router-default-6b9786dcbb-7fm8w   1/1     Running   0          17d<br><br>kubectl get pods -n presentation-tier<br>NAME                                     READY   STATUS    RESTARTS   AGE<br>presentation-tier-app-55ff596f97-26fnb   2/2     Running   0          7s<br>presentation-tier-app-55ff596f97-kgc8b   2/2     Running   0          7s<br>presentation-tier-app-55ff596f97-m2tfc   2/2     Running   0          11d<br><br><br>kubectl get service -n presentation-tier -o yaml<br>apiVersion: v1<br>items:<br>- apiVersion: v1<br>  kind: Service<br>  metadata:<br>    annotations:<br>      kubectl.kubernetes.io/last-applied-configuration: |<br>        {&quot;apiVersion&quot;:&quot;v1&quot;,&quot;kind&quot;:&quot;Service&quot;,&quot;metadata&quot;:{&quot;annotations&quot;:{&quot;service.alpha.openshift.io/serving-cert-secret-name&quot;:&quot;presentation-tier-app-tls&quot;},&quot;name&quot;:&quot;presentation-tier-app&quot;,&quot;namespace&quot;:&quot;presentation-tier&quot;},&quot;spec&quot;:{&quot;ports&quot;:[{&quot;name&quot;:&quot;presentation-tier-app&quot;,&quot;port&quot;:443,&quot;targetPort&quot;:8443}],&quot;selector&quot;:{&quot;app&quot;:&quot;presentation-tier-app&quot;}}}<br>      service.alpha.openshift.io/serving-cert-secret-name: presentation-tier-app-tls<br>      service.alpha.openshift.io/serving-cert-signed-by: openshift-service-serving-signer@1698204371<br>      service.beta.openshift.io/serving-cert-signed-by: openshift-service-serving-signer@1698204371<br>    creationTimestamp: &quot;2023-10-31T17:31:47Z&quot;<br>    name: presentation-tier-app<br>    namespace: presentation-tier<br>    resourceVersion: &quot;3262942&quot;<br>    uid: 2db64c52-6ba7-41af-9c07-6258811de9aa<br>  spec:<br>    clusterIP: 172.21.15.93<br>    clusterIPs:<br>    - 172.21.15.93<br>    internalTrafficPolicy: Cluster<br>    ipFamilies:<br>    - IPv4<br>    ipFamilyPolicy: SingleStack<br>    ports:<br>    - name: presentation-tier-app<br>      port: 443<br>      protocol: TCP<br>      targetPort: 8443<br>    selector:<br>      app: presentation-tier-app<br>    sessionAffinity: None<br>    type: ClusterIP<br>  status:<br>    loadBalancer: {}<br>kind: List<br>metadata:<br>  resourceVersion: &quot;&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9kuCZQGQu4u-97emnuY_0A.png" /><figcaption>Presentation Tier Webpage and Associated Certificate info</figcaption></figure><p>A few things on this configuration: one is the traffic is encrypted with TLS from the client to the openshift router. The openshift router then terminates TLS and establishes another TLS connection to the backend presentation tier app. This means that traffic is always encrypted through TLS throughout the entire path of transferring the network. In the first part: the openshift router as part of the platform is configured with certs from Let’s Encrypt that automatically renew as part of the core Satellite platform. In the openshift router -&gt; presentation tier TLS connection: note that the presentation-tier app requests TLS certs from the openshift service CA operator with the <em>service.alpha.openshift.io/serving-cert-secret-name </em>tag. That annotation will trigger the openshift service CA operator to generate service specific certificates associated with the appropriate service shown below that the presentation app service can then mount:</p><pre>kubectl get secret -n presentation-tier | grep presentation-tier-app-tls<br>presentation-tier-app-tls               kubernetes.io/tls                     2      12d<br>kubectl get deploy -n presentation-tier presentation-tier-app -o yaml<br>...<br>        - --tls-cert=/etc/tls/private/tls.crt<br>        - --tls-key=/etc/tls/private/tls.key<br>...<br>        volumeMounts:<br>        - mountPath: /etc/tls/private<br>          name: presentation-tier-app-tls<br>...<br>      volumes:<br>      - name: presentation-tier-app-tls<br>        secret:<br>          defaultMode: 420<br>          secretName: presentation-tier-app-tls</pre><p>This effectively solves ensuring all traffic in transit to/from the presentation tier is encrypted. Additionally: we want to implement ingress and egress controls on the namespace which we do with the network policy below:</p><pre>  - apiVersion: networking.k8s.io/v1<br>    kind: NetworkPolicy<br>    metadata:<br>      name: presentation-tier-app-isolation<br>      namespace: presentation-tier<br>    spec:<br>      podSelector: { }<br>      policyTypes:<br>        - Ingress<br>        - Egress<br>      ingress:<br>        - from:<br>            # allow openshift ingress if exposing app through router pods<br>            - namespaceSelector:<br>                matchLabels:<br>                  kubernetes.io/metadata.name: openshift-ingress<br>            # allow monitoring namespace to scrape pods for metrics<br>            - namespaceSelector:<br>                matchLabels:<br>                  kubernetes.io/metadata.name: openshift-monitoring<br>      egress:<br>        # oauth server traffic<br>        - to:<br>            - ipBlock:<br>                cidr: 10.240.0.57/32<br>            - ipBlock:<br>                cidr: 10.240.0.59/32<br>            - ipBlock:<br>                cidr: 10.240.0.61/32<br>          ports:<br>            - protocol: TCP<br>              port: 30857<br>        # kube apiserver traffic<br>        - to:<br>            - ipBlock:<br>                cidr: 172.20.0.1/32<br>          ports:<br>            - protocol: TCP<br>              port: 2040<br>        - to:<br>            # for routing to other ingress points<br>            - namespaceSelector:<br>                matchLabels:<br>                  kubernetes.io/metadata.name: application-tier-app<br>            # for dns resolution<br>            - namespaceSelector:<br>                matchLabels:<br>                  kubernetes.io/metadata.name: openshift-dns</pre><p>This policy allows the presentation tier to communicate to it’s dependencies:</p><ul><li>Openshift DNS for DNS resolution</li><li>Application Tier to be able to access the dependent APIs</li><li>Kube-Apiserver &amp; OAUTH Server to authenticate and authorize users to the webpage</li></ul><p>All other traffic is blocked. This can be seen by execing into a pod and attempting to curl google.com</p><pre>bash-4.4$ curl --connect-timeout 2 -v https://google.com<br>* Rebuilt URL to: https://google.com/<br>*   Trying 172.253.122.102...<br>* Failed to connect to google.com port 443: Connection timed out<br>* Closing connection 0<br>curl: (7) Failed to connect to google.com port 443: Connection timed out<br>bash-4.4$</pre><p>Additionally: only supporting local cluster monitoring services and openshift ingress are allowed to send traffic into the namespace. This can be seen by going into an unapproved namespace and trying to send traffic to the service:</p><pre>kubectl exec -it -n application-tier-app application-tier-app-6c7ddfc5b-n2pmq bash<br>kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.<br>bash-4.4$ curl -v --connect-timeout 2 https://presentation-tier-app.presentation-tier.svc.cluster.local<br>* Rebuilt URL to: https://presentation-tier-app.presentation-tier.svc.cluster.local/<br>*   Trying 172.21.15.93...<br>* TCP_NODELAY set<br>* Connection timed out after 2001 milliseconds<br>* Closing connection 0<br>curl: (28) Connection timed out after 2001 milliseconds</pre><p>This implements controlled ingress and egress in the presentation tier namespace. Additionally: openshift oauth proxy is utilized to validate individual user access to the presentation tier. The openshift oauth proxy utilizes IBM Cloud IAM and Openshift RBAC to validate a user has access to specific resources before allowing them to proceed to access the application. In the example environment: the user accessing the application is validated that he/she is authorized to get services in the default namespace</p><pre>        containers:<br>        - args:<br>          - --https-address=:8443<br>          - --provider=openshift<br>          - --openshift-service-account=presentation-tier-app<br><strong>          - --openshift-delegate-urls={&quot;/&quot;:{&quot;namespace&quot;:&quot;default&quot;,&quot;resource&quot;:&quot;services&quot;,&quot;verb&quot;:&quot;get&quot;}}<br></strong>          - --upstream=http://localhost:8080<br>          - --tls-cert=/etc/tls/private/tls.crt<br><strong>          - --openshift-sar={&quot;namespace&quot;:&quot;default&quot;,&quot;resource&quot;:&quot;services&quot;,&quot;resourceName&quot;:&quot;proxy&quot;,&quot;verb&quot;:&quot;get&quot;}<br></strong>          - --tls-key=/etc/tls/private/tls.key<br>          - --cookie-secret=XXXXXXX<br>          image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:35bb6d5f135f1763bf305d71465718978ee1ab73625a2094e42116d52d4b7bd2<br>          imagePullPolicy: IfNotPresent<br>          name: oauth-proxy<br>          ports:<br>          - containerPort: 8443<br>            name: public<br>            protocol: TCP<br>          resources: {}<br>          terminationMessagePath: /dev/termination-log<br>          terminationMessagePolicy: File<br>          volumeMounts:<br>          - mountPath: /etc/tls/private<br>            name: presentation-tier-app-tls<br>        - image: openshift/hello-openshift:latest<br>          imagePullPolicy: Always<br>          name: app<br>          resources: {}<br>          terminationMessagePath: /dev/termination-log<br>          terminationMessagePolicy: File</pre><p>When attempting to access the application through a browser a user will be asked to login through openshift to get an identity first:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*junsGjjRLBNdUYLi9cZw7g.png" /><figcaption>Login Page For Presentation Tier App</figcaption></figure><p>Once authenticated and the user’s access is validated: the content will be displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKE8LV4cm4osK9YnH1CQ7g.png" /><figcaption>Content Displayed to Authorized User</figcaption></figure><p>If they are not authorized they will see a error screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQrSaOtioQ2G0Hjosuv2Fw.png" /><figcaption>Unauthorized Screen</figcaption></figure><p>This same solution can also be utilized to authenticate and authorize application to application traffic when the application passes the service account token it is granted in an Authorization header to a application running with the sidecar openshift oauth proxy. An example of that is shown below:</p><pre>curl -H &quot;Authorization: Bearer XXXX&quot; https://presentation-tier-app-presentation-tier.tyler-cloudpak-2-d-31-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud/<br>Hello OpenShift!</pre><p>This gives a pluggable solution without any dependencies outside the Satellite platform to authenticate and authorize users for applications. Often times government organizations will already have an approved local IAM system and that can also be utilized (typically built into the backend applications that are deployed in the environment). When using those: just ensure the network policy is also updated to allow the presentation tier application to utilize the necessary endpoints for the external identity and access management solution.</p><p><strong>Openshift Router -&gt; Application Tier<br>Presentation Tier -&gt; Application Tier</strong></p><p>The application tier will be accessed both externally (directly calling APIs) and through the applications running in the presentation tier. Ingress and Egress controls are implemented in the policy shown below:</p><pre>  - apiVersion: networking.k8s.io/v1<br>    kind: NetworkPolicy<br>    metadata:<br>      name: application-tier-app-isolation<br>      namespace: application-tier-app<br>    spec:<br>      podSelector: { }<br>      policyTypes:<br>        - Ingress<br>        - Egress<br>      ingress:<br>        - from:<br>            # allow presentation tier to communicat<br>            - namespaceSelector:<br>                matchLabels:<br>                  kubernetes.io/metadata.name: presentation-tier<br>            # allow openshift ingress if exposing app through router pods<br>            - namespaceSelector:<br>                matchLabels:<br>                  kubernetes.io/metadata.name: openshift-ingress<br>            # allow monitoring namespace to scrape pods for metrics<br>            - namespaceSelector:<br>                matchLabels:<br>                  kubernetes.io/metadata.name: openshift-monitoring<br>      egress:<br>        - to:<br>            # for talking to backend cluster local database<br>            - namespaceSelector:<br>                matchLabels:<br>                  kubernetes.io/metadata.name: database-tier-app<br>            # for dns resolution<br>            - namespaceSelector:<br>                matchLabels:<br>                  kubernetes.io/metadata.name: openshift-dns</pre><p>Since the APIs will also be able to be accessed externally: ingress is allowed from the openshift-ingress namespace. Additionally: ingress is allowed from the presentation tier to talk to the dependent APIs so the presentation tier can properly display webpages. For egress: the application tier is allowed to talk to the backend database (deployed locally in the cluster) and openshift DNS. The application tier will also make use of the openshift service CA to sign it’s internal server cert</p><pre>kubectl get service -n application-tier-app  application-tier-app -o yaml<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  annotations:<br>    kubectl.kubernetes.io/last-applied-configuration: |<br>      {&quot;apiVersion&quot;:&quot;v1&quot;,&quot;kind&quot;:&quot;Service&quot;,&quot;metadata&quot;:{&quot;annotations&quot;:{&quot;service.alpha.openshift.io/serving-cert-secret-name&quot;:&quot;application-tier-app-tls&quot;},&quot;labels&quot;:{&quot;app&quot;:&quot;application-tier-app&quot;},&quot;name&quot;:&quot;application-tier-app&quot;,&quot;namespace&quot;:&quot;application-tier-app&quot;},&quot;spec&quot;:{&quot;ports&quot;:[{&quot;port&quot;:443,&quot;protocol&quot;:&quot;TCP&quot;,&quot;targetPort&quot;:20000}],&quot;selector&quot;:{&quot;app&quot;:&quot;application-tier-app&quot;},&quot;sessionAffinity&quot;:&quot;None&quot;,&quot;type&quot;:&quot;ClusterIP&quot;}}<br>    service.alpha.openshift.io/serving-cert-secret-name: application-tier-app-tls<br>    service.alpha.openshift.io/serving-cert-signed-by: openshift-service-serving-signer@1698204371<br>    service.beta.openshift.io/serving-cert-signed-by: openshift-service-serving-signer@1698204371<br>  creationTimestamp: &quot;2023-10-31T17:46:46Z&quot;<br>  labels:<br>    app: application-tier-app<br>  name: application-tier-app<br>  namespace: application-tier-app<br>  resourceVersion: &quot;3559581&quot;<br>  uid: f8719770-7d06-4459-a54a-d654f08c3035<br>spec:<br>  clusterIP: 172.21.21.198<br>  clusterIPs:<br>  - 172.21.21.198<br>  internalTrafficPolicy: Cluster<br>  ipFamilies:<br>  - IPv4<br>  ipFamilyPolicy: SingleStack<br>  ports:<br>  - port: 443<br>    protocol: TCP<br>    targetPort: 20000<br>  selector:<br>    app: application-tier-app<br>  sessionAffinity: None<br>  type: ClusterIP<br>status:<br>  loadBalancer: {}<br><br>kubectl get deploy -n application-tier-app  application-tier-app -o yaml<br>...<br>      containers:<br>      - args:<br>        - cat /etc/tls/private/tls.crt /etc/tls/private/tls.key &gt; /tmp/combined.pem;<br>          chmod 0400 /tmp/combined.pem; haproxy -f /usr/local/etc/haproxy/haproxy.conf<br>        command:<br>        - /bin/bash<br>        - -c<br>        - --<br>...<br>        volumeMounts:<br>        - mountPath: /usr/local/etc/haproxy<br>          name: conf<br>        - mountPath: /etc/tls/private<br>          name: application-tier-app-tls<br>...<br>      volumes:<br>      - configMap:<br>          defaultMode: 420<br>          name: application-tier-app-conf<br>        name: conf<br>      - name: application-tier-app-tls<br>        secret:<br>          defaultMode: 420<br>          secretName: application-tier-app-tls</pre><p>The usage of the common openshift service CA operator enables encryption in transit of traffic both from external clients directly to APIs and from the presentation tier to APIs. An example request for both is shown below:</p><pre>kubectl exec -it -n presentation-tier presentation-tier-app-55ff596f97-26fnb bash<br>bash-4.4$ curl --cacert /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt https://application-tier-app.application-tier-app.svc.cluster.local/monitor<br>&lt;html&gt;&lt;body&gt;&lt;h1&gt;200 OK&lt;/h1&gt;<br>Service ready.<br>&lt;/body&gt;&lt;/html&gt;<br><br>$ curl https://application-tier-app-application-tier-app.tyler-cloudpak-2-d-31-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud/monitor<br>&lt;html&gt;&lt;body&gt;&lt;h1&gt;200 OK&lt;/h1&gt;<br>Service ready.<br>&lt;/body&gt;&lt;/html&gt;</pre><p><strong>Application Tier -&gt; Database Tier</strong></p><p>The database tier has no external dependencies and runs a local database. The network policy to implement ingress and egress controls are shown below:</p><pre>  - apiVersion: networking.k8s.io/v1<br>    kind: NetworkPolicy<br>    metadata:<br>      name: database-tier-app-isolation<br>      namespace: database-tier-app<br>    spec:<br>      podSelector: { }<br>      policyTypes:<br>        - Ingress<br>        - Egress<br>      ingress:<br>        - from:<br>            - namespaceSelector:<br>                matchLabels:<br>                  kubernetes.io/metadata.name: application-tier-app<br>            # allow monitoring namespace to scrape pods for metrics<br>            - namespaceSelector:<br>                matchLabels:<br>                  kubernetes.io/metadata.name: openshift-monitoring<br>      egress:<br>        - to:<br>            # for dns resolution<br>            - namespaceSelector:<br>                matchLabels:<br>                  kubernetes.io/metadata.name: openshift-dns</pre><p>It allows ingress from the application tier to successfully execute the API suite the application tier provides. Additionally: the database deployment utilizes ODF encrypted with IBM HyperProtect Crypto Services Keep Your Own Key Encryption. The sample configuration is shown below:</p><pre>kubectl get deploy -n database-tier-app database-tier-app -o yaml<br>...<br>        volumeMounts:<br>        - mountPath: /usr/local/etc/haproxy<br>          name: conf<br>        - mountPath: /etc/tls/private<br>          name: database-tier-app-tls<br>        - mountPath: /var/persistentdata<br>          name: database-tier-app-pvc<br>...<br>      volumes:<br>      - configMap:<br>          defaultMode: 420<br>          name: database-tier-app-conf<br>        name: conf<br>      - name: database-tier-app-tls<br>        secret:<br>          defaultMode: 420<br>          secretName: database-tier-app-tls<br>      - name: database-tier-app-pvc<br>        persistentVolumeClaim:<br>          claimName: database-tier-app-pvc<br><br>$ kubectl get pvc -n database-tier-app -o yaml<br>apiVersion: v1<br>items:<br>- apiVersion: v1<br>  kind: PersistentVolumeClaim<br>  metadata:<br>    annotations:<br>      kubectl.kubernetes.io/last-applied-configuration: |<br>        {&quot;apiVersion&quot;:&quot;v1&quot;,&quot;kind&quot;:&quot;PersistentVolumeClaim&quot;,&quot;metadata&quot;:{&quot;annotations&quot;:{},&quot;name&quot;:&quot;database-tier-app-pvc&quot;,&quot;namespace&quot;:&quot;database-tier-app&quot;},&quot;spec&quot;:{&quot;accessModes&quot;:[&quot;ReadWriteMany&quot;],&quot;resources&quot;:{&quot;requests&quot;:{&quot;storage&quot;:&quot;8Gi&quot;}},&quot;storageClassName&quot;:&quot;sat-ocs-cephfs-gold&quot;,&quot;volumeMode&quot;:&quot;Filesystem&quot;}}<br>      pv.kubernetes.io/bind-completed: &quot;yes&quot;<br>      pv.kubernetes.io/bound-by-controller: &quot;yes&quot;<br>      volume.beta.kubernetes.io/storage-provisioner: openshift-storage.cephfs.csi.ceph.com<br>      volume.kubernetes.io/storage-provisioner: openshift-storage.cephfs.csi.ceph.com<br>    creationTimestamp: &quot;2023-11-01T00:42:56Z&quot;<br>    finalizers:<br>    - kubernetes.io/pvc-protection<br>    name: database-tier-app-pvc<br>    namespace: database-tier-app<br>    resourceVersion: &quot;3494697&quot;<br>    uid: f02f7392-73e0-42ab-a391-faf138bc8586<br>  spec:<br>    accessModes:<br>    - ReadWriteMany<br>    resources:<br>      requests:<br>        storage: 8Gi<br>    storageClassName: sat-ocs-cephfs-gold<br>    volumeMode: Filesystem<br>    volumeName: pvc-f02f7392-73e0-42ab-a391-faf138bc8586<br>  status:<br>    accessModes:<br>    - ReadWriteMany<br>    capacity:<br>      storage: 8Gi<br>    phase: Bound<br>kind: List<br>metadata:<br>  resourceVersion: &quot;&quot;<br><br>$ kubectl exec -it -n database-tier-app database-tier-app-85dfc84974-zpw2s bash<br>kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.<br>bash-4.4$ ls -l /var/preserve/<br>total 0<br>bash-4.4$ ls -l /var/persistentdata/    <br>total 1<br>-rw-r--r--. 1 1000640000 1000640000 3 Nov  1 00:44 hi</pre><p>The storage template that deploys ODF contains the configuration to link it to the backend HCPS instance that will hold the keys that encrypt all the persistent storage ODF manages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ydkJuBolKZWEwf1pZdmuzg.png" /></figure><p>With this deployment model: encryption at rest has been implemented at a rest for all application data as well. The platform administrator controls access to the keys through HCPS and can revoke access/keys at any time and effectively stop access to any local persistent data in the Satellite environment.</p><p><strong>Threat Detection &amp; Response with SCC Workload Protection</strong></p><p>Now that we have outlined the core data path and the implementation of controls around it for the three tier application: let’s look at SCC Workload Protection which will enable a threat detection and response solution within the environment. SCC workload protection gathers activity logs from all events on the hosts and within the Openshift Platform itself and provides analytics and alerting engines to detect and respond to anamolous activity. It also provides compliance policy validation against numerous policy standards including HIPPA, Fedramp, PCI, SOC 2, and more. The agents are deployed into the cluster and the associated data can be viewed in the workload protection page:</p><pre>kubectl get pods -n ibm-observe | grep sysd<br>sysdig-agent-4br7f                            1/1     Running   0              11d<br>sysdig-agent-57lxk                            1/1     Running   0              11d<br>sysdig-agent-8vx7n                            1/1     Running   0              11d<br>sysdig-agent-f4f4d                            1/1     Running   0              11d<br>sysdig-agent-kspmcollector-55cd59f959-l58hl   1/1     Running   0              11d<br>sysdig-agent-node-analyzer-9b4w4              3/3     Running   1 (8d ago)     11d<br>sysdig-agent-node-analyzer-fqm76              3/3     Running   0              11d<br>sysdig-agent-node-analyzer-gn9p6              3/3     Running   1 (4d4h ago)   11d<br>sysdig-agent-node-analyzer-hfkz8              3/3     Running   0              11d<br>sysdig-agent-node-analyzer-lzz56              3/3     Running   0              11d<br>sysdig-agent-xwljg                            1/1     Running   0              11d</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nHzhbNX5Di5miciNksGDfw.png" /><figcaption>SCC Workload Protection Activity Page</figcaption></figure><p>This solution provides the ability for SOC teams associated with government entities to get advanced insights into the activity in ROKS on Satellite clusters and setup alerts that enable them to detect anomalous activity and validate with their organization if the activity is benign or malicious. To read more about the advanced capabilities of this solution: refer to <a href="https://cloud.ibm.com/docs/workload-protection?topic=workload-protection-getting-started">SCC Workload Protections documentation page</a>.</p><p><strong>Logging</strong></p><p>The IBM Log Analysis agent is also deployed into the environment for the logging portion of the observability solution. Application logs can be visualized overtime in the IBM Log Analysis UI and alerts setup for specific activity or lack of activity from applications. To read more about the advanced capabilities of this solution: refer to <a href="https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-getting-started">IBM Log Analysis’s getting started pa</a>ge.</p><pre>kubectl get pods -n ibm-observe | grep log<br>logdna-agent-4fht2                            1/1     Running   1 (2d4h ago)   11d<br>logdna-agent-j27wg                            1/1     Running   0              11d<br>logdna-agent-j7q76                            1/1     Running   0              11d<br>logdna-agent-lflpf                            1/1     Running   0              11d<br>logdna-agent-x4kv8                            1/1     Running   0              11d</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*thmx5Uf5yROn7hiwuBNCzQ.png" /></figure><p><strong>Core Platform Outbound Traffic</strong></p><p>The environment makes use of the reduced firewall location configuration of Satellite to only require a minimal set of outbound networking requirements (port 443 on a small set of IPs plus the additional outbound network requirements of addon software of ODF, SCC Workload Protection, and IBM Log Analysis). In this mode: agents are deployed on all hosts that proxy the dependent platform traffic through Satellite link and provide full auditability, visibility, and control of all traffic flows. This configuration is useful when integrating into existing regulated environments with complex firewall rules/network egress controls.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac9a0a6fe5ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep Dive Into Disconnected Mode in IBM Satellite]]></title>
            <link>https://lisowski0925.medium.com/deep-dive-into-disconnected-mode-in-ibm-satellite-37bcfbbbf3f0?source=rss-846da30431d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/37bcfbbbf3f0</guid>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[hybrid-cloud]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Tyler Lisowski]]></dc:creator>
            <pubDate>Tue, 24 Oct 2023 03:07:45 GMT</pubDate>
            <atom:updated>2023-10-28T18:52:40.954Z</atom:updated>
            <content:encoded><![CDATA[<p>When IBM Cloud Satellite is deployed into on-premise datacenters or at the edge: events can occur across the lifecycle of the datacenter or edge site that lead to the local site becoming disconnected from the IBM Cloud Satellite Management Plane running in IBM Cloud or any external networks from the site. With IBM Cloud Satellite: all consumer workload and data is local to the site hosting the Satellite Location. The management of the platform services deployed through IBM Cloud Satellite into the location are administered over a remote connection through Satellite Link. When the site is disconnected from the remote management plane: existing workload is unaffected and continues to run and be accessible to clients that have access to the site. The set of management operations provided remotely from the managed from region are unavailable until the connection is established. Let’s dive deeper into how that looks below.</p><p><strong>Disconnected Mode</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kXYSrDfgD60Y0fWzr4yECA.png" /><figcaption>Consumption and Operation Patterns in Disconnected Mode</figcaption></figure><p>We can dive deeper into how this looks in practice by using a sample Haproxy application that we will use as an example custom application deployed into a ROKS on Satellite cluster. The application is going to return a 200 on a path /monitor to start shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PiN08VbIczp9BLDGXcjusA.png" /><figcaption>Sample HAProxy Application running locally within the satellite environment</figcaption></figure><pre>kubectl get route -n sample-app-1<br>NAME           HOST/PORT                                                                                                                 PATH   SERVICES       PORT    TERMINATION     WILDCARD<br>sample-app-1   sample-app-1-sample-app-1.tyler-cloudpak-2-d-19-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud          sample-app-1   20000   edge/Redirect   None<br><br>nslookup sample-app-1-sample-app-1.tyler-cloudpak-2-d-19-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud<br>Server:  172.31.255.241<br>Address: 172.31.255.241#53<br><br>Non-authoritative answer:<br>sample-app-1-sample-app-1.tyler-cloudpak-2-d-19-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud canonical name = tyler-cloudpak-2-d-19-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud.<br>Name: tyler-cloudpak-2-d-19-80d128fecd199542426020c17e5e9430-0000.ca-tor.containers.appdomain.cloud<br>Address: 10.240.0.45<br><br>kubectl get pods -n sample-app-1 -o wide<br>NAME                            READY   STATUS    RESTARTS   AGE     IP               NODE                      NOMINATED NODE   READINESS GATES<br>sample-app-1-79cd7566d8-c5cvf   1/1     Running   0          2m51s   172.30.209.186   tyler-cloudpak-2-d-19-4   &lt;none&gt;           &lt;none&gt;<br>sample-app-1-79cd7566d8-rhb6k   1/1     Running   0          2m52s   172.30.219.205   tyler-cloudpak-2-d-19-2   &lt;none&gt;           &lt;none&gt;<br><br>kubectl get pvc -n sample-app-1<br>NAME               STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS          AGE<br>sample-app-1-pvc   Bound    pvc-c5b7e2e9-12a5-483c-b63f-298700401736   8Gi        RWX            sat-ocs-cephfs-gold   2m33s<br><br>kubectl exec -it -n sample-app-1 sample-app-1-79cd7566d8-rhb6k -- bash<br>bash-4.4$ ls -l /etc/pvdata/<br>total 1<br>-rw-r--r--. 1 1000710000 1000710000 4 Oct 23 18:58 bye<br>-rw-r--r--. 1 1000710000 1000710000 3 Oct 23 18:57 hi<br><br>kubectl get node -o wide<br>NAME                      STATUS   ROLES           AGE    VERSION            INTERNAL-IP    EXTERNAL-IP   OS-IMAGE                                                        KERNEL-VERSION                 CONTAINER-RUNTIME<br>tyler-cloudpak-2-d-19-1   Ready    master,worker   172d   v1.25.12+26bab08   10.240.0.45    &lt;none&gt;        Red Hat Enterprise Linux CoreOS 412.86.202308300700-0 (Ootpa)   4.18.0-372.71.1.el8_6.x86_64   cri-o://1.25.4-4.rhaos4.12.gitb9319a2.el8<br>tyler-cloudpak-2-d-19-2   Ready    master,worker   172d   v1.25.12+26bab08   10.240.0.46    &lt;none&gt;        Red Hat Enterprise Linux CoreOS 412.86.202308300700-0 (Ootpa)   4.18.0-372.71.1.el8_6.x86_64   cri-o://1.25.4-4.rhaos4.12.gitb9319a2.el8<br>tyler-cloudpak-2-d-19-4   Ready    master,worker   172d   v1.25.12+26bab08   10.240.0.47    &lt;none&gt;        Red Hat Enterprise Linux CoreOS 412.86.202308300700-0 (Ootpa)   4.18.0-372.71.1.el8_6.x86_64   cri-o://1.25.4-4.rhaos4.12.gitb9319a2.el8<br></pre><p>The application also uses persistent volumes for a persistent local filestore. In this example: I am running from a browser within the site this Satellite location is deployed in (connected to the private 10.240.0.0/16 network). The traffic goes from my browser to the worker nodes associated with the ROKS cluster at the site, through the local Openshift Router load balancer, and ultimately to my backend sample application pods. We are now going to perform the same operations when the Satellite Location is in a disconnected mode to show how existing workload is unaffected. We are going to disconnect the site from the remote management plane by disabling system endpoints in Satellite Link:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f4GfJDx99gIbV6BV6X5aeA.png" /><figcaption>Disabling healthcheck connection</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ucxKQHs_A_i7Liy2J5YfNQ.png" /><figcaption>Disabling registry traffic flow</figcaption></figure><p>With these disabled: traffic is shut down between these endpoints which result in the Location entering a disconnected state. This can also be done by orchestrating configuration updates to a local firewall or network appliance in the site hosting the Satellite Location. We will now see the status of the Satellite Location update to reflect that it is in a disconnected state and <em>action is required</em> to be taken before remote administration of the platform services can be performed again (which we will dive into later).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*FFSC1MuKbL-Bf1r-8_FANg.png" /></figure><p>Now with us entering disconnected mode: we will reaccess the application and see that everything is behaving as expected</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ohemw974_V3FiNgen0luOg.png" /></figure><p>We can also continue to read/write persistent application data</p><pre>kubectl exec -it -n sample-app-1 sample-app-1-79cd7566d8-rhb6k -- bash<br>bash-4.4$ echo hi2 &gt; /etc/pvdata/hi2<br>bash-4.4$ ls -l /etc/pvdata/<br>total 2<br>-rw-r--r--. 1 1000710000 1000710000 4 Oct 23 18:58 bye<br>-rw-r--r--. 1 1000710000 1000710000 3 Oct 23 18:57 hi<br>-rw-r--r--. 1 1000710000 1000710000 4 Oct 23 19:22 hi2</pre><p>What we will notice though is platform operations are going to be disabled including the upgrading of Openshift clusters shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iZ6QU5ae6_0f3dzOjrgyVg.png" /></figure><p>And provisioning of new cluster instances shown below:</p><pre>bx cs cluster create satellite --name tyler-cloudpak-2-d-30 --location tyler-cloudpak-2 --version 4.12_openshift<br>Creating cluster...<br>FAILED<br>Cluster management is not currently available for this Satellite location. The location requires action to enable cluster operations. Please see logs for more detailed information. (Ebe1e)<br><br>Incident ID: 42dfa95f-697e-4e26-8b78-e88db155cafe</pre><p>Back to the local site: we will see recovery of failed application instances continue to work as expected along with scaling of the application instance</p><pre>kubectl delete pods -n sample-app-1 sample-app-1-79cd7566d8-c5cvf <br>pod &quot;sample-app-1-79cd7566d8-c5cvf&quot; deleted<br><br>kubectl get pods -n sample-app-1 -o wide<br>NAME                            READY   STATUS        RESTARTS   AGE   IP               NODE                      NOMINATED NODE   READINESS GATES<br>sample-app-1-79cd7566d8-c5cvf   1/1     Terminating   0          31m   172.30.209.186   tyler-cloudpak-2-d-19-4   &lt;none&gt;           &lt;none&gt;<br>sample-app-1-79cd7566d8-rhb6k   1/1     Running       0          31m   172.30.219.205   tyler-cloudpak-2-d-19-2   &lt;none&gt;           &lt;none&gt;<br>sample-app-1-79cd7566d8-zxwdp   1/1     Running       0          8s    172.30.195.193   tyler-cloudpak-2-d-19-1   &lt;none&gt;           &lt;none&gt;<br><br>kubectl scale -n sample-app-1 --replicas 3 deploy/sample-app-1<br>deployment.apps/sample-app-1 scaled<br>Tylers-MacBook-Pro-2:~ tylerlisowski$ kubectl get pods -n sample-app-1 -o wide<br>NAME                            READY   STATUS              RESTARTS   AGE   IP               NODE                      NOMINATED NODE   READINESS GATES<br>sample-app-1-79cd7566d8-pld2p   0/1     ContainerCreating   0          4s    &lt;none&gt;           tyler-cloudpak-2-d-19-4   &lt;none&gt;           &lt;none&gt;<br>sample-app-1-79cd7566d8-rhb6k   1/1     Running             0          32m   172.30.219.205   tyler-cloudpak-2-d-19-2   &lt;none&gt;           &lt;none&gt;<br>sample-app-1-79cd7566d8-zxwdp   1/1     Running             0          66s   172.30.195.193   tyler-cloudpak-2-d-19-1   &lt;none&gt;           &lt;none&gt;<br><br>Tylers-MacBook-Pro-2:~ tylerlisowski$ kubectl get pods -n sample-app-1 -o wide<br>NAME                            READY   STATUS    RESTARTS   AGE   IP               NODE                      NOMINATED NODE   READINESS GATES<br>sample-app-1-79cd7566d8-pld2p   1/1     Running   0          9s    172.30.209.140   tyler-cloudpak-2-d-19-4   &lt;none&gt;           &lt;none&gt;<br>sample-app-1-79cd7566d8-rhb6k   1/1     Running   0          32m   172.30.219.205   tyler-cloudpak-2-d-19-2   &lt;none&gt;           &lt;none&gt;<br>sample-app-1-79cd7566d8-zxwdp   1/1     Running   0          71s   172.30.195.193   tyler-cloudpak-2-d-19-1   &lt;none&gt;           &lt;none&gt;</pre><p>We will see deployment of new versions of the application will fail <strong>only because it has a dependency outside of the local site (in this case deployment of new non cached versions depends on access to IBM Cloud us.icr.io’s registry)</strong></p><pre>NAME                            READY   STATUS              RESTARTS   AGE<br>sample-app-1-6fb6474dfd-78pl8   0/1     ContainerCreating   0          38s<br>sample-app-1-6fb6474dfd-gbgqx   0/1     ErrImagePull        0          37s<br>sample-app-1-79cd7566d8-rhb6k   1/1     Running             0          35m<br><br>kubectl describe pods -n sample-app-1 sample-app-1-6fb6474dfd-gbgqx <br>Events:<br>  Type     Reason             Age                 From                Message<br>  ----     ------             ----                ----                -------<br>  Warning  FailedScheduling   2m18s               default-scheduler   0/4 nodes are available: 1 node(s) were unschedulable, 3 node(s) didn&#39;t match pod anti-affinity rules. preemption: 0/4 nodes are available: 1 Preemption is not helpful for scheduling, 3 No preemption victims found for incoming pod.<br>  Normal   Scheduled          107s                default-scheduler   Successfully assigned sample-app-1/sample-app-1-6fb6474dfd-gbgqx to tyler-cloudpak-2-d-19-1<br>  Normal   NotTriggerScaleUp  2m15s               cluster-autoscaler  pod didn&#39;t trigger scale-up:<br>  Normal   AddedInterface     102s                multus              Add eth0 [172.30.195.242/32] from k8s-pod-network<br>  Warning  Failed             23s (x6 over 102s)  kubelet             Error: ImagePullBackOff<br>  Normal   Pulling            12s (x4 over 102s)  kubelet             Pulling image &quot;us.icr.io/armada-master/ocp-release@sha256:8d0bc889aa28a871142d9c80a2ad2c096b569ab98491e0efcc7c3319e8549ba5&quot;<br>  Warning  Failed             12s (x4 over 102s)  kubelet             Failed to pull image &quot;us.icr.io/armada-master/ocp-release@sha256:8d0bc889aa28a871142d9c80a2ad2c096b569ab98491e0efcc7c3319e8549ba5&quot;: rpc error: code = Unknown desc = pinging container registry us.icr.io: Get &quot;https://us.icr.io/v2/&quot;: dial tcp 169.254.3.8:443: connect: connection refused<br>  Warning  Failed             12s (x4 over 102s)  kubelet             Error: ErrImagePull<br>  Normal   BackOff            1s (x7 over 102s)   kubelet             Back-off pulling image &quot;us.icr.io/armada-master/ocp-release@sha256:8d0bc889aa28a871142d9c80a2ad2c096b569ab98491e0efcc7c3319e8549ba5&quot;</pre><p>We can prove this is the case by pulling the image from a registry that the site still is connected to (de.icr.io)</p><pre>kubectl get pods -n sample-app-1<br>NAME                            READY   STATUS    RESTARTS   AGE<br>sample-app-1-5574874c75-f9l7z   1/1     Running   0          48s<br>sample-app-1-5574874c75-m6bmz   1/1     Running   0          48s<br><br>kubectl describe pods -n sample-app-1 sample-app-1-5574874c75-f9l7z<br>Events:<br>  Type     Reason                  Age   From                     Message<br>  ----     ------                  ----  ----                     -------<br>  Warning  FailedScheduling        65s   default-scheduler        0/4 nodes are available: 1 node(s) were unschedulable, 3 node(s) didn&#39;t match pod anti-affinity rules. preemption: 0/4 nodes are available: 1 Preemption is not helpful for scheduling, 3 No preemption victims found for incoming pod.<br>  Warning  FailedScheduling        64s   default-scheduler        0/4 nodes are available: 1 node(s) were unschedulable, 3 node(s) didn&#39;t match pod anti-affinity rules. preemption: 0/4 nodes are available: 1 Preemption is not helpful for scheduling, 3 No preemption victims found for incoming pod.<br>  Normal   Scheduled               61s   default-scheduler        Successfully assigned sample-app-1/sample-app-1-5574874c75-f9l7z to tyler-cloudpak-2-d-19-1<br>  Normal   SuccessfulAttachVolume  61s   attachdetach-controller  AttachVolume.Attach succeeded for volume &quot;pvc-c5b7e2e9-12a5-483c-b63f-298700401736&quot;<br>  Normal   AddedInterface          52s   multus                   Add eth0 [172.30.195.254/32] from k8s-pod-network<br>  Normal   Pulling                 52s   kubelet                  Pulling image &quot;de.icr.io/armada-master/ocp-release@sha256:8d0bc889aa28a871142d9c80a2ad2c096b569ab98491e0efcc7c3319e8549ba5&quot;<br>  Normal   Pulled                  42s   kubelet                  Successfully pulled image &quot;de.icr.io/armada-master/ocp-release@sha256:8d0bc889aa28a871142d9c80a2ad2c096b569ab98491e0efcc7c3319e8549ba5&quot; in 9.425140995s (9.425166694s including waiting)<br>  Normal   Created                 42s   kubelet                  Created container sample-app-1<br>  Normal   Started                 42s   kubelet                  Started container sample-app-1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ccqgH5cQLfFs-bwnYEt3oQ.png" /></figure><p>Now: we will proceed to re-establish connection to the necessary endpoints which will then enable us to the platform operations again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UHPwYM4ZYNsjVEkn7YGdzw.png" /></figure><p>With the endpoints enabled our location goes back to a connected state and we can do platform operations again like provision new Openshift clusters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eVBZno0bq8Zpuutzsxe1iw.png" /></figure><pre>bx cs cluster create satellite --name tyler-cloudpak-2-d-31 --enable-config-admin --operating-system RHCOS --location tyler-cloudpak-2 --enable-config-admin --version 4.12_openshift <br>Creating cluster...<br>OK<br>Cluster created with ID ckrdnalr0psd72bt16sg</pre><p><strong>Openshift Console Access</strong></p><p>In ROKS on Satellite environments: users access the openshift console through OAUTH tokens issued by Openshift’s OAUTH server. For Oauth access: a user is redirected to the identity provider (IBM Cloud IAM) and once the user completes authentication with the provider they are issued a oauth access token to interact with the Openshift Console (and associated Kubernetes APIs). This token has a default duration of 24 hours. The duration of newly issued tokens can be modified by changing the <a href="https://cloud.ibm.com/docs/satellite?topic=satellite-disconnected-use#disconnect-time"><em>oauthclients resource</em></a><em>. </em>In the context of disconnected mode: when the environment is disconnected from the IBM Cloud managed from region: new clients will be unable to complete the OAUTH protocol and therefore cannot access the Openshift Console. For users that have already completed the protocol and have a session token: they will be able to interact with the Openshift console until the token expires (configurable with a field in the oauthclient resources in the cluster).</p><p><strong>Kubernetes API Server Access</strong></p><p>To access the Kubernetes API directly either the oauth token described previously can be used or X509 certificates can be used for user authentication. X509 certificate authentication and authorization is all done locally within the Openshift cluster control plane and has no external dependencies. Since the Openshift control plane runs locally within the site hosting the Satellite environment: this strategy will work indefinitely in a disconnected mode. I wrote a detailed article on using that pattern for user access <a href="https://medium.com/@lisowski0925/using-kubernetes-csrs-and-rbac-for-cluster-user-authentication-and-authorization-9df5498655cd">here</a>. Kubernetes API Server access using the OAUTH token follows the same pattern and limitations described in the Openshift Console Access section.</p><p>This hopefully gives a deeper look on how and what operations can be done in Satellite Locations while in a disconnected state. Although certain platform (Openshift cluster upgrades &amp; new provisions) operations are disabled in this mode: all workload operation flows can be executed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37bcfbbbf3f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using RHCOS Enabled Satellite Locations and Host Link Agent to Deploy into Restricted Network…]]></title>
            <link>https://lisowski0925.medium.com/using-rhcos-enabled-satellite-locations-and-host-link-agent-to-deploy-into-restricted-network-864229326559?source=rss-846da30431d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/864229326559</guid>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[edge-computing]]></category>
            <dc:creator><![CDATA[Tyler Lisowski]]></dc:creator>
            <pubDate>Thu, 06 Apr 2023 03:54:58 GMT</pubDate>
            <atom:updated>2023-10-20T14:30:37.861Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using RHCOS Enabled Satellite Locations and Host Link Agent to Deploy into Restricted Network Environments</h3><p>Clients occasionally struggle to adopt distributed cloud solutions based on the number of outbound IPs/domains that are necessary for successful deployment of the solution. Often times cloud provider endpoints are proxied through a global CDN that has millions of IPs in it’s total CDN network. For these sites: IP based firewalls aren’t feasible do to the dynamic nature of the in use IPs in these networks. Domain based firewalls can still be used but often times require specialized external proxy boxes to proxy and analyze all outbound traffic. These boxes can become a single point of failure for outbound traffic and can be expensive to maintain and manage overtime. IBM Cloud Satellite provides a solution for clients to have a single set of domains with a manageable number of IPs to integrate into either IP firewall environments or domain based firewall environments for management of the platform. The setup of that solution is outlined below:</p><p>The solution requires a RHCOS Enabled Satellite Locations to be created. This can be done by running the following command:</p><pre>ibmcloud sat location create --name LOCATION_NAME --managed-from MANAGED_FROM_REGION --coreos-enabled<br><br>#Example below:<br>ibmcloud sat location create --name tyler-cloudpak-2 --managed-from tor --coreos-enabled</pre><p>While the location is creating: we can prepare to associate the infrastructure in the restricted environment to the location. To do that: we will download the ignition based configuration necessary to pass to the machine at boot time with the commands below. The command will specify to add the host link agent for proxying host outbound connections through Satellite Link and which endpoint to connect to the Link Tunnel Server on:</p><pre>ibmcloud sat host attach --location LOCATION_NAME --host-link-agent-endpoint --operating-system RHCOS<br><br># Link agent endpoint unique per region and typically in format of: c-01-ws.REGION.link.satellite.cloud.ibm.com<br># Can be found in firewall docs for region: https://cloud.ibm.com/docs/satellite?topic=satellite-reqs-host-rhcos-outbound-tor<br># example<br>ibmcloud sat host attach --location tyler-cloudpak-2  --host-link-agent-endpoint c-01-ws.ca-tor.link.satellite.cloud.ibm.com --operating-system RHCOS</pre><p>Note that outbound connection on port 443 will need to be allowed in the restricted environment for that destination. The IPs associated with that endpoint can be seen in the firewall documentation and are typically only 3 total IPs at a given time. Additionally: NTP traffic needs to be allowed on the machine. Typically in restricted environments: there is a local NTP server endpoint that can be configured where no additional outbound access is needed through the firewall (see <a href="https://cloud.ibm.com/docs/satellite?topic=satellite-config-custom-ntp#custom-ntp-config">https://cloud.ibm.com/docs/satellite?topic=satellite-config-custom-ntp#custom-ntp-config</a>). With those flows allowed: we can now proceed to boot the infrastructure with the ignition payload and the host will join the location. The following commands can be ran to detect when it joined:</p><pre>ibmcloud sat  hosts --location LOCATION_NAME | grep unassigned<br><br># example<br>ibmcloud sat  hosts --location cfvc53er0iv3t8s7jvug | grep unassigned<br>tyler-restrictedboot-1   5879e53d0ddc683be40b   unassigned   Ready    *</pre><p>We proceed to boot all the hosts we need for the initial setup (minimum of 6 hosts for the control plane nodes of a RHCOS enabled location) and can assign them to the appropriate zones.</p><pre>ibmcloud sat host assign --location LOCATION_NAME --host-label os=RHCOS --zone ZONE_1<br>ibmcloud sat host assign --location LOCATION_NAME --host-label os=RHCOS --zone ZONE_1<br>ibmcloud sat host assign --location LOCATION_NAME --host-label os=RHCOS --zone ZONE_2<br>ibmcloud sat host assign --location LOCATION_NAME --host-label os=RHCOS --zone ZONE_2<br>ibmcloud sat host assign --location LOCATION_NAME --host-label os=RHCOS --zone ZONE_3<br>ibmcloud sat host assign --location LOCATION_NAME --host-label os=RHCOS --zone ZONE_3<br>ibmcloud sat hosts --location LOCATION_NAME<br><br># example<br>ibmcloud sat host assign --location tyler-cloudpak-2 --host-label os=RHCOS --zone ca-tor-1<br>ibmcloud sat host assign --location tyler-cloudpak-2 --host-label os=RHCOS --zone ca-tor-1<br>ibmcloud sat host assign --location tyler-cloudpak-2 --host-label os=RHCOS --zone ca-tor-2<br>ibmcloud sat host assign --location tyler-cloudpak-2 --host-label os=RHCOS --zone ca-tor-2<br>ibmcloud sat host assign --location tyler-cloudpak-2 --host-label os=RHCOS --zone ca-tor-3<br>ibmcloud sat host assign --location tyler-cloudpak-2 --host-label os=RHCOS --zone ca-tor-3<br>ibmcloud sat hosts --location tyler-cloudpak-2<br>Retrieving hosts...<br>OK<br>Name                     ID                     State        Status   Zone       Cluster              Worker ID                                                 Worker IP<br>tyler-cloudpak-1         ea8acd8d97c7d97a7812   assigned     Ready    ca-tor-3   infrastructure       sat-tylercloud-3849c6894c5f90e001180adb6dc8842f6269e0f5   10.240.0.57<br>tyler-cloudpak-2         ca29528fb5a253b9d298   assigned     Ready    ca-tor-1   infrastructure       sat-tylercloud-ce5bb4aae06295eb6c9769f7349a1f46dba27646   10.240.0.58<br>tyler-cloudpak-3         7a8ad1a44eba7d59d715   assigned     Ready    ca-tor-1   infrastructure       sat-tylercloud-cc2f5a4e6fc2044340d8f7e99fd438fdecd7dc71   10.240.0.59<br>tyler-cloudpak-4         2b523aeda417bd3c6d64   assigned     Ready    ca-tor-3   infrastructure       sat-tylercloud-415e49749e70b97cf7c5fba2ed4f7f051498f88b   10.240.0.60<br>tyler-cloudpak-5         e6016f36d42b48d3d012   assigned     Ready    ca-tor-2   infrastructure       sat-tylercloud-5cc50b6b61bc226261f87077f756fa038d6d0478   10.240.0.61<br>tyler-cloudpak-6         d04b6342817b6ab5a4f2   assigned     Ready    ca-tor-2   infrastructure       sat-tylercloud-dfb6c2da0256029510330b8dbb32dec249263e65   10.240.0.62<br></pre><p>Once the hosts joined: the location will get configured and be ready for operations. Once configured: a ROKS on Satellite cluster can be ordered in the environment with:</p><pre>ibmcloud ks cluster create satellite --name CLUSTER_NAME --location LOCATION_NAME --operating-system RHCOS --version VERSION<br><br>#example<br>ibmcloud ks cluster create satellite --name tyler-cloudpak-d-2 --location tyler-cloudpak-2 --operating-system RHCOS --version 4.11_openshift</pre><p>Once the order is placed further hosts from the restricted network environment can be booted with the same host attach payload downloaded earlier. They can be assigned to the ROKS on Satellite cluster with:</p><pre>ibmcloud sat host assign --location LOCATION_NAME --cluster CLUSTER_NAME --host-label os=RHCOS --zone ZONE<br>ibmcloud sat hosts --location LOCATION_NAME | grep CLUSTER_NAME<br><br>#example<br>ibmcloud sat host assign --location tyler-cloudpak-2 --cluster tyler-cloudpak-d-2 --host-label os=RHCOS --zone ca-tor-1 <br>ibmcloud sat hosts --location tyler-cloudpak-2 | grep tyler-cloudpak-d-2<br>tyler-cloudpak-d-2-1     1c1c34d930c648f4a0a7   assigned     Ready    ca-tor-1   tyler-cloudpak-d-2   sat-tylercloud-4af393693f58a82e4663c671fc96012cadb8996d   10.240.64.11<br>tyler-cloudpak-odf-1     0b64c72cf9fcec66de00   assigned     Ready    ca-tor-1   tyler-cloudpak-d-2   sat-tylercloud-1a8848ff619756704f0eb79de44ea878a2165ed1   10.240.0.64<br>tyler-cloudpak-odf-2     20e3c4ba465f94509523   assigned     Ready    ca-tor-1   tyler-cloudpak-d-2   sat-tylercloud-60dfdc3ca156327598358c76438b28219ae3f72d   10.240.0.65<br>tyler-cloudpak-odf-3     a810c4ee5ee46f13c4f1   assigned     Ready    ca-tor-1   tyler-cloudpak-d-2   sat-tylercloud-3251419ed6bf188632bdef21dc403e2fa83b7172   10.240.0.66</pre><p>Congragulations! At this point you have setup all the core resources of IBM Cloud Satellite in a restricted network environment by just having to allowing traffic to a single endpoint through the firewall (assuming local NTP servers). Additionally: all core platform networking traffic can now be monitored and controlled through Satellite Link. The endpoints along with the destinations of each endpoints can be seen in the Link Endpoints UI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8zTcFfBN1M1ffxEAgFdshQ.png" /><figcaption>System endpoints for an example RHCOS Enabled Satellite Location for a Restricted Network Environment</figcaption></figure><p>These endpoints will report statistics around traffic flows and can be enabled/disabled at anytime (disabling system endpoints will result in the location entering a disconnected state and having reduced management functionality as a result). The groups of system endpoints (agent, local, etc) target traffic from different networking layers of the environment (SDN layer, host network layer, etc).</p><h3>Notes:</h3><ul><li>User application specific traffic (example: running builds from Openshift samples) will not get proxied. Openshift Sample Builds oftentimes reach out to github.com which typically is not allowed in these environments so those will fail unless traffic is allowed through firewall.</li><li>Addon system components (software defined storage solutions, monitoring solutions, etc) deployed into ROKS on Satellite clusters do not have traffic proxied. Consult documentation for individual components for ability to proxy individual traffic flows through Satellite Link or if a direct outbound connection is required for the endpoints the systems interact with.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=864229326559" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Strategies for exposing applications in IBM Cloud Satellite]]></title>
            <link>https://lisowski0925.medium.com/strategies-for-exposing-applications-in-ibm-cloud-satellite-3bbd62b777a1?source=rss-846da30431d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bbd62b777a1</guid>
            <dc:creator><![CDATA[Tyler Lisowski]]></dc:creator>
            <pubDate>Fri, 09 Dec 2022 03:11:13 GMT</pubDate>
            <atom:updated>2022-12-09T03:28:56.827Z</atom:updated>
            <content:encoded><![CDATA[<p>By default: Satellite ROKS clusters come with an ingress domain that points to the IPs of the worker nodes in the ROKS cluster. These IPs are typically in a private network and consumers will often want to expose the applications running on these ROKS clusters to outside networks like the Internet. A few common patterns for that are discussed below:</p><p><strong>Exposing the default router through a NAT Gateway</strong></p><p>In this pattern: an IP is set to NAT to a worker node in the ROKS cluster (direct port forwarding). A domain is created that points to the NAT IP to provide a DNS mapping to the NAT IP address (the TLS certificates associated with the domain are automatically created and managed as part of the domain as well). From there routes can be created to publish the route through the NAT IP. In our example: the NAT IP will be utilized to expose the sample application to the Internet.</p><p>We will illustrate this process by exposing a sample cli download application in a Satellite Red Hat Openshift cluster. We first start out with a ROKS cluster inside an existing private network:</p><pre>ibmcloud ks cluster get --cluster cbqg0h3w0scd7l9mc6gg<br>Retrieving cluster cbqg0h3w0scd7l9mc6gg...<br>OK<br>                                             <br>Name:                                     tyler-loc-useast-d-1   <br>ID:                                       cbqg0h3w0scd7l9mc6gg   <br>State:                                    normal   <br>Status:                                   All Workers Normal   <br>Created:                                  2022-08-11 08:12:36 -0500 (3 months ago)   <br>Resource Group ID:                        f4bf7759b43c4d1a859e328dc363e478   <br>Resource Group Name:                      default   <br>Pod Subnet:                               172.30.0.0/16   <br>Service Subnet:                           172.21.0.0/16   <br>Workers:                                  2   <br>Worker Zones:                             us-east-1   <br>Ingress Subdomain:                        tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0000.us-east.containers.appdomain.cloud   <br>Ingress Secret:                           tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0000   <br>Ingress Status:                           healthy   <br>Ingress Message:                          All Ingress components are healthy.   <br>Public Service Endpoint URL:              https://c-01.private.us-east.link.satellite.cloud.ibm.com:32915   <br>Private Service Endpoint URL:             https://t80bc734cb074c8b16595-6b64a6ccc9c596bf59a86625d8fa2202-ce00.us-east.satellite.appdomain.cloud:30617   <br>Pull Secrets:                             enabled in the default namespace   <br>VPCs:                                     -   <br>Pod network interface selection method:   kubernetes=NodeInternalIP   <br><br>Master         <br>Status:     Ready (3 weeks ago)   <br>State:      deployed   <br>Health:     normal   <br>Version:    4.11.12_1532_openshift   <br>Location:   tyler-loc-useast   <br>URL:        https://t80bc734cb074c8b16595-6b64a6ccc9c596bf59a86625d8fa2202-ce00.us-east.satellite.appdomain.cloud:30617<br><br><br>ibmcloud ks workers --cluster cbqg0h3w0scd7l9mc6gg<br>OK<br>ID                                                        Primary IP    Flavor   State    Status   Zone        Version   <br>sat-tylertestt-6b232b18eb144361d0f27011b7f2eec52e43b802   10.240.0.19   upi      normal   Ready    us-east-1   4.11.13_1533_openshift   <br>sat-tylertestt-c50eabbf3519e3bed71206765a1a4784ac3c2d2e   10.240.0.20   upi      normal   Ready    us-east-1   4.11.13_1533_openshift<br><br>ibmcloud ks nlb-dns ls --cluster cbqg0h3w0scd7l9mc6gg<br>OK<br>Hostname                                                                                        IP(s)                     Health Monitor   SSL Cert Status   SSL Cert Secret Name                                         Secret Namespace    Status   <br>tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0000.us-east.containers.appdomain.cloud   10.240.0.19,10.240.0.20   disabled         created           tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0000   openshift-ingress   OK</pre><p>The ROKS on Satellite cluster has worker nodes with private IPs and the default ingress domain is setup to point to those IPs. In the infrastructure provider: we are going to setup a NAT IP 150.239.82.80 that will point to the IP of sat-tylertestt-6b232b18eb144361d0f27011b7f2eec52e43b802: 10.240.0.19 . Next we are going to create a new domain that will point to the NAT IP:</p><pre>ibmcloud ks nlb-dns create classic --cluster cbqg0h3w0scd7l9mc6gg --ip 150.239.82.80 --secret-namespace openshift-ingress<br>OK<br>NLB hostname was created as tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0001.us-east.containers.appdomain.cloud and registered in public DNS<br>Note: It might take a few minutes for your changes to be applied.<br><br>nslookup tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0001.us-east.containers.appdomain.cloud 8.8.8.8<br>Server:  8.8.8.8<br>Address: 8.8.8.8#53<br><br>Non-authoritative answer:<br>Name: tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0001.us-east.containers.appdomain.cloud<br>Address: 150.239.82.80<br><br><br><br>ibmcloud ks nlb-dns ls --cluster cbqg0h3w0scd7l9mc6gg<br>OK<br>Hostname                                                                                        IP(s)                     Health Monitor   SSL Cert Status   SSL Cert Secret Name                                         Secret Namespace    Status   <br>tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0000.us-east.containers.appdomain.cloud   10.240.0.19,10.240.0.20   disabled         created           tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0000   openshift-ingress   OK   <br>tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0001.us-east.containers.appdomain.cloud   150.239.82.80             None             created           tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0001   openshift-ingress   OK</pre><p>Once that domain is created: we can now create a route that is configured for that subdomain and then send traffic to the sample application</p><pre>ibmcloud cs cluster config --cluster cbqg0h3w0scd7l9mc6gg --admin<br>cat &lt;&lt;EOF &gt;/tmp/route.yaml<br>apiVersion: route.openshift.io/v1<br>kind: Route<br>metadata:<br>  name: route-passthrough-downloads<br>  namespace: openshift-console<br>spec:<br>  host: downloads.tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0001.us-east.containers.appdomain.cloud<br>  port:<br>    targetPort: http<br>  to:<br>    kind: Service<br>    name: downloads<br>EOF<br>oc apply -f /tmp/route.yaml</pre><p>With this configured: we can now access the service locally over the Internet through the NAT IP:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6hlfGKpEyUML8VfIAQnKuA.png" /><figcaption>Accessing downloads application through NAT</figcaption></figure><p><strong>Route Sharding with a Load Balancer + Dedicated Router</strong></p><p>Sometimes: a user only wants to expose a subset of routes over a given network. In this case: we can use route sharding with dedicated router instances to accomplish the goal.</p><p>In this example: we assume we have a load balancer that has a IP of 150.239.83.52 and can load balance traffic across worker nodes associated with the ROKS on Satellite cluster. First: we are going to create a new ingress subdomain that we will point to the load balancer IP:</p><pre>ibmcloud ks nlb-dns create classic --cluster cbqg0h3w0scd7l9mc6gg --ip 150.239.83.52 --secret-namespace openshift-ingress<br>OK<br>NLB hostname was created as tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0002.us-east.containers.appdomain.cloud and registered in public DNS<br>Note: It might take a few minutes for your changes to be applied.<br><br>nslookup tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0002.us-east.containers.appdomain.cloud 8.8.8.8<br>Server:  8.8.8.8<br>Address: 8.8.8.8#53<br><br>Non-authoritative answer:<br>Name: tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0002.us-east.containers.appdomain.cloud<br>Address: 150.239.83.52<br><br>ks nlb-dns ls --cluster cbqg0h3w0scd7l9mc6gg<br>OK<br>Hostname                                                                                        IP(s)                     Health Monitor   SSL Cert Status   SSL Cert Secret Name                                         Secret Namespace    Status   <br>tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0000.us-east.containers.appdomain.cloud   10.240.0.19,10.240.0.20   disabled         created           tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0000   openshift-ingress   OK   <br>tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0001.us-east.containers.appdomain.cloud   150.239.82.80             None             created           tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0001   openshift-ingress   OK   <br>tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0002.us-east.containers.appdomain.cloud   150.239.83.52             None             created           tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0002   openshift-ingress   OK</pre><p>Then we are going to create a dedicated router instance that will only serve routes with a specific label of type=lb-ingress . We will also apply the route that will match with that</p><pre>ibmcloud cs cluster config --cluster cbqg0h3w0scd7l9mc6gg --admin<br>cat &lt;&lt;EOF &gt;/tmp/ingctr.yaml<br>apiVersion: operator.openshift.io/v1<br>kind: IngressController<br>metadata:<br>  name: lb-ingress<br>  namespace: openshift-ingress-operator<br>spec:<br>  domain: tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0002.us-east.containers.appdomain.cloud<br>  defaultCertificate:<br>    name: tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0002<br>  endpointPublishingStrategy:<br>    type: NodePortService<br>  replicas: 2<br>  routeSelector:<br>    matchLabels:<br>      type: lb-ingress<br>EOF<br>oc apply -f /tmp/ingctr.yaml<br>cat &lt;&lt;EOF &gt;/tmp/route.yaml<br>apiVersion: route.openshift.io/v1<br>kind: Route<br>metadata:<br>  name: downloads-lb<br>  namespace: openshift-console<br>  labels:<br>    type: lb-ingress<br>spec:<br>  host: downloads.tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0002.us-east.containers.appdomain.cloud<br>  port:  <br>    targetPort: http<br>  tls:<br>    insecureEdgeTerminationPolicy: Redirect<br>    termination: edge<br>  to:<br>    kind: Service<br>    name: downloads<br>    weight: 100<br>EOF<br>oc apply -f /tmp/route.yaml</pre><p>Once applied: we will now gather at the backend node port configuration for the router to configure the backend of the load balancer for:</p><pre>kubectl get service -n openshift-ingress  router-nodeport-lb-ingress<br>NAME                         TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)                                     AGE<br>router-nodeport-lb-ingress   NodePort   172.21.14.104   &lt;none&gt;        80:32106/TCP,443:32527/TCP,1936:30282/TCP   63m<br></pre><p>In our example: port 32106 on the two worker node IPs will be the backend for the front end load balancer listener on port 80 for HTTP. For HTTPS: the front end load balancer will listen on port 443 and forward to port 32527 on the two worker node IPs (use TCP forwarding). Once this is configured in the load balancer: the downloads service can be accessed over the load balancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*03n08UAK8DjjkJR6G28z1Q.png" /><figcaption>Accessing downloads application through Load Balancer</figcaption></figure><p><strong>Expose through local floating IP with Metal-LB</strong></p><p>If the hybrid cloud environment has floating IPs available: then Metal-LB can be utilized to provision load balancer services natively in Openshift that hook into those floating IPs. Metal-LB will manage the floating IP in a highly available fashion with it’s <a href="https://metallb.universe.tf/concepts/layer2/">member list protocol and using L2 gratuitous ARPs</a>: failing over the floating IP to healthy machines in the cluster. IBM Cloud has a great existing guide of that workflow: <a href="https://cloud.ibm.com/docs/openshift?topic=openshift-sat-expose-apps#sat-expose-metallb">https://cloud.ibm.com/docs/openshift?topic=openshift-sat-expose-apps#sat-expose-metallb</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bbd62b777a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running a Windows 2019 Server VM in IBM Cloud Satellite with Openshift Virtualization]]></title>
            <link>https://lisowski0925.medium.com/running-a-windows-2019-server-vm-in-ibm-cloud-satellite-with-openshift-virtualization-234aa9a01def?source=rss-846da30431d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/234aa9a01def</guid>
            <category><![CDATA[kubevirt]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[hybrid-cloud]]></category>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[openshift-virtualization]]></category>
            <dc:creator><![CDATA[Tyler Lisowski]]></dc:creator>
            <pubDate>Mon, 03 Oct 2022 01:53:34 GMT</pubDate>
            <atom:updated>2022-10-03T01:53:47.608Z</atom:updated>
            <content:encoded><![CDATA[<p>Some client environments will run a workload fleet that is composed of a mix of VM and container workload. In some situations: these workloads need to communicate together to accomplish an overall business goal (ie execute a user workflow/action). As covered in this <a href="https://lisowski0925.medium.com/centralizing-ingress-traffic-across-vms-and-containers-using-openshift-c0a14aec535c">previous post</a>: containerized workload running within IBM Cloud Satellite can seamlessly communicate with VMs running within the datacenter hosting the Satellite location. However: some client environments do not have an existing virtualization environment (VMWare, Openstack, AWS, etc) to boot VMs within the datacenter running the Satellite location. In these environments: a client will only have a set of baremetal machines that they can dedicate to running both VM and containerized workload. ROKS on IBM Cloud Satellite with Openshift Virtualization can be utilized in these environments to provide a virtualization environment for booting VMs in addition to running containerized workload. In this guide: we will walk through booting a Windows 2019 Server VM in a baremetal IBM Cloud Satellite environment.</p><h4>Prerequisites</h4><p>First: a Red Hat CoreOS enabled Satellite location must be created. That can be created with the following command: ibmcloud sat location create --name LOCATION_NAME --managed-from REGION --coreos-enabled . Infrastructure is then attached to the location to build out the control plane according to the sizing guidelines <a href="https://cloud.ibm.com/docs/satellite?topic=satellite-location-sizing#control-plane-how-many-clusters-rhcos">outlined in this documentation page</a>. Once infrastructure is assigned to the location and the location is configured: a ROKS cluster is ordered within the location using ibmcloud ks cluster create satellite --name ROKS_CLUSTER_NAME --location LOCATION_NAME --version &lt;4.11_openshift or higher&gt; --operating-system RHCOS. VM workload is only able to run on Red Hat CoreOS baremetal infrastructure assigned to a ROKS on Satellite cluster (typically all infrastructure in these environments are baremetals running Red Hat CoreOS). Within the ROKS on Satellite cluster: follow the <a href="https://docs.openshift.com/container-platform/4.11/virt/install/installing-virt-web.html">upstream documentation for installing Openshift Virtualization</a>. Lastly: a <a href="https://cloud.ibm.com/docs/satellite?topic=satellite-sat-storage-template-ov#storage-template-ov-providers">persistent storage solution</a> needs to be deployed into the ROKS on Satellite cluster to host the VM disks. This guide will use an environment that is already pre provisioned: consult <a href="https://cloud.ibm.com/docs/satellite?topic=satellite-attach-hosts">IBM Cloud Satellite’s documentation</a> for getting an environment setup in this manner.</p><p>For booting a Windows 2019 Server VM: a user needs to have a license for using Windows 2019 Server. An evaluation ISO can be downloaded from <a href="https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2019">Microsoft</a>. This ISO then needs to be available to be downloaded from an endpoint accessible from within the ROKS on Satellite cluster running Openshift Virtualization. This guide will host the ISO in IBM Cloud Object storage.</p><h4>Booting the Windows VM</h4><p>We will use the console based workflow to boot the Windows 2019 VM. A CLI workflow can also be executed but is not covered in this guide. The first step is to login to the Openshift console for the ROKS on Satellite cluster and go to the VirtualMachine page shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*reLUrXodX7ZjINDKlNMXKQ.png" /><figcaption>Openshift VirtualMachine Console Page</figcaption></figure><p>On this page: we will create a VM from the catalog with Create -&gt; From Catalog. On the catalog page we will select the Microsoft Windows Server 2019 VM option and click Customize VirtualMachine shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OfsVlSgPSrXMob7bdVhOnA.png" /><figcaption>Microsoft Windows Server 2019 VM Option</figcaption></figure><p>On the customization page: we will select the Boot from CD option and reference the URL that the Windows VM ISO can be downloaded from. We need to ensure the persistent volume that runs the disk is large enough to hold the ISO. Additionally: in the Disk Source option: we specify the size of the main disk that will be the root disk of the windows VM. Also, ensure the Mount Windows drivers disk option is deselected. The filled out page for our environment is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yWFCl9y8JCn2BWEjYQdGyA.png" /><figcaption>Windows Server 2019 VM Customization Page</figcaption></figure><p>With this information filled out we click Review and create VirtualMachine to review the details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UaS2iS1WMcZeIgzzAL3fTA.png" /><figcaption>VM Details Page</figcaption></figure><p>One thing we need to ensure before booting the VM is that the boot order is appropriately set to the following priority:<br>1) rootdisk<br>2) installation-cdrom</p><p>We will do that by going to the YAML tab of the review page and check the boot order section of the VM (shown below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q0AffNIwrceaYRKOOmjs2w.png" /><figcaption>Proper boot order for Windows 2019 Server VM</figcaption></figure><p>We will click Save and then go back to the Overview page and click Create VirtualMachine (ignore the warning if it pops up and click proceed as it is not applicable for booting from ISOs). Once created: an importer pod will be created in the namespace you created the VM in. It will proceed to import the ISO (logs can be viewed to show percentage complete).</p><pre>Tylers-MacBook-Pro:~ tylerlisowski$ kubectl logs importer-win2k19-striped-mollusk-installation-cdrom<br>I1001 20:28:02.948632       1 importer.go:83] Starting importer<br>I1001 20:28:02.948674       1 importer.go:150] begin import process<br>I1001 20:28:03.884405       1 data-processor.go:379] Calculating available size<br>I1001 20:28:03.884557       1 data-processor.go:391] Checking out file system volume size.<br>I1001 20:28:03.884584       1 data-processor.go:399] Request image size not empty.<br>I1001 20:28:03.884599       1 data-processor.go:404] Target size 10226112610.<br>I1001 20:28:03.909286       1 nbdkit.go:294] Waiting for nbdkit PID.<br>I1001 20:28:04.410102       1 nbdkit.go:315] nbdkit ready.<br>I1001 20:28:04.410145       1 data-processor.go:282] New phase: Convert<br>I1001 20:28:04.410180       1 data-processor.go:288] Validating image<br>I1001 20:28:05.196989       1 qemu.go:259] 0.00<br>I1001 20:28:13.012100       1 qemu.go:259] 1.03<br>I1001 20:28:20.948293       1 qemu.go:259] 2.06<br>...</pre><p>Once complete: we can go back to the VirtualMachine page and access the console to walk through the Window’s Server Operating System Installation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Ch5UKOV9zid14ISL0wc3Q.png" /><figcaption>Windows Server 2019 Install Window</figcaption></figure><p>We will click Next and then Install now, and then select Windows Server 2019 Standard Evaluation, click Next and accept the terms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SswZ3xx9H2b2qmSjQpud0A.png" /><figcaption>Windows Server 2019 Install Window</figcaption></figure><p>Then we will choose Custom: Install Windows only (advanced):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-TpLagZt_df6h_6OfwXRg.png" /><figcaption>Windows Server 2019 Install Window</figcaption></figure><p>Then choose the Blank drive we created when customizing the VM and click next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OcQgQqFWVV8v6xZlm7mXLA.png" /></figure><p>It will proceed to install Windows. You can monitor the progress in the console window:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1vGQHDGQ3X9v3KabGQbAGQ.png" /></figure><p>Once complete: you will be able to set an Administrator password and access a terminal on the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qcUzyFmDwNl4SESNyoBFvQ.png" /></figure><p>Once set you will now have access to the shell on the Windows VM:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YY9YrFBulhmE5DUj5fkmnA.png" /></figure><p>And within that VM: you have access to the Openshift cluster SDN network. For example: we can curl the downloads service in the openshift-console namespace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JCUGR2OFcb1TSI_a3jQJmA.png" /></figure><p>Congratulations! You have now successfully booted a Windows Server 2019 VM and demonstrated how the workload running on it can seamlessly communicate with existing containerized workload in the cluster.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=234aa9a01def" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Centralizing Ingress Traffic Across VMs and Containers using Openshift]]></title>
            <link>https://lisowski0925.medium.com/centralizing-ingress-traffic-across-vms-and-containers-using-openshift-c0a14aec535c?source=rss-846da30431d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0a14aec535c</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[cloud-modernization]]></category>
            <category><![CDATA[hybrid-cloud]]></category>
            <dc:creator><![CDATA[Tyler Lisowski]]></dc:creator>
            <pubDate>Sat, 24 Sep 2022 14:17:30 GMT</pubDate>
            <atom:updated>2022-09-24T14:17:30.886Z</atom:updated>
            <content:encoded><![CDATA[<p>Companies at various phases of their cloud modernization process can have a workload fleet consisting of both containers and VMs. Often times: they are still interested in having a single point of network ingress across this mixed environment. Openshift offers a robust set of options for containerized workload with Openshift Router, network policies, and LoadBalancer services. These same components can additionally be configured to send ingress traffic to VM based workload as well. This guide will illustrate these scenarios using IBM Cloud Satellite and ROKS on IBM Cloud Satellite with a private VPC running both VM workload and containerized workload.</p><h3>Openshift Router Solution</h3><p>To illustrate this solution: we start by running a VM colocated in the private VPC of a ROKS on Satellite cluster. The 7 Satellite hosts that makeup the environment are shown below:</p><pre>ibmcloud sat hosts --location tyler-loc-useast<br>Retrieving hosts...<br><strong>OK<br>Name</strong>                <strong>ID</strong>                     <strong>State</strong>      <strong>Status</strong>   <strong>Zone</strong>        <strong>Cluster</strong>                <strong>Worker ID</strong>                                                 <strong>Worker IP<br>tyler-testtest-11</strong>   b9a5a03e7261221bf65a   assigned   Ready    us-east-1   infrastructure         sat-tylertestt-6909322966b8d8eb10fc45a0299852dead5a1591   10.240.0.21<br><strong>tyler-testtest-12</strong>   41794a98a9b3db902c6d   assigned   Ready    us-east-2   infrastructure         sat-tylertestt-c29a0fff49a7d710fc943222513f490c11246c04   10.240.0.22<br><strong>tyler-testtest-13</strong>   4dcc290c9dbed1ab4a3c   assigned   Ready    us-east-3   infrastructure         sat-tylertestt-a94a00c0088445306913c08aae2212b064fb3c22   10.240.0.23<br><strong>tyler-testtest-2</strong>    787058c8d516a74131f7   assigned   Ready    us-east-3   infrastructure         sat-tylertestt-d72e5734ed6199b4e0ff223c6335e349ea39226a   10.240.0.77<br><strong>tyler-testtest-3</strong>    3d13d3e4aaea788ce3e7   assigned   Ready    us-east-2   infrastructure         sat-tylertestt-84999d4c14c83044ea3b4e418e4badfd677b5f20   10.240.0.78<br><strong>tyler-testtest-8</strong>    48d0ebbbdd4eb0b8a24c   assigned   Ready    us-east-1   tyler-loc-useast-d-1   sat-tylertestt-6b232b18eb144361d0f27011b7f2eec52e43b802   10.240.0.19<br><strong>tyler-testtest-9</strong>    1f199aacadbc702e36d8   assigned   Ready    us-east-1   tyler-loc-useast-d-1   sat-tylertestt-c50eabbf3519e3bed71206765a1a4784ac3c2d2e   10.240.0.20</pre><p>The VM running workload colocated in the VPC has an IP of 10.240.64.8<strong> </strong>and is shown below:</p><pre>[root@tyler-vm-1 ~]# ip addr</pre><pre>2: ens3: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000<br>link/ether 02:00:0b:06:d5:50 brd ff:ff:ff:ff:ff:ff<br>altname enp0s3<br>inet <strong>10.240.64.8</strong>/24 metric 100 brd 10.240.64.255 scope global dynamic ens3<br>valid_lft 204sec preferred_lft 204sec<br>inet6 fe80::bff:fe06:d550/64 scope link<br>valid_lft forever preferred_lft forever</pre><p>To simulate workload running on the VM we launch a simple python http server:</p><pre>root@tyler-vm-1:~# python3 -m http.server<br>Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...</pre><p>With this in place: we now apply the configuration that will configure an Openshift Route for the backend VM. The configuration to do that is shown below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d8e1bc41ec1912de4ffd472f52c18c0/href">https://medium.com/media/3d8e1bc41ec1912de4ffd472f52c18c0/href</a></iframe><p>With this configuration: TLS will terminate at the router and it will proceed to forward the HTTP request to the backend VM. At this point: we can now curl the ingress route and reach the backend VM application:</p><pre>$ kubectl apply -f tyler-vm-forward.yaml<br>namespace/tyler-vm created<br>service/app-1 created<br>endpoints/app-1 created<br>route.route.openshift.io/app-1 created</pre><pre>$  curl <a href="https://app-1-tyler-vm.tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0000.us-east.containers.appdomain.cloud/">https://app-1-tyler-vm.tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0000.us-east.containers.appdomain.cloud</a><br>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;<br>&lt;title&gt;Directory listing for /&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;h1&gt;Directory listing for /&lt;/h1&gt;<br>&lt;hr&gt;<br>&lt;ul&gt;<br>&lt;li&gt;&lt;a href=&quot;.bashrc&quot;&gt;.bashrc&lt;/a&gt;&lt;/li&gt;<br>&lt;li&gt;&lt;a href=&quot;.cache/&quot;&gt;.cache/&lt;/a&gt;&lt;/li&gt;<br>&lt;li&gt;&lt;a href=&quot;.profile&quot;&gt;.profile&lt;/a&gt;&lt;/li&gt;<br>&lt;li&gt;&lt;a href=&quot;.ssh/&quot;&gt;.ssh/&lt;/a&gt;&lt;/li&gt;<br>&lt;li&gt;&lt;a href=&quot;snap/&quot;&gt;snap/&lt;/a&gt;&lt;/li&gt;<br>&lt;/ul&gt;<br>&lt;hr&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Additional features of the Openshift Router beyond TLS termination can be utilized as well with this architecture. Additional redundant VM application instances could be added to the setup by modifying the Endpoint yaml section to contain multiple IPs. An external controller could also be deployed that performed health checking against the VM endpoints and removed/added endpoints into that content as appropriate to be able to dynamically add/remove unhealthy endpoints. That advanced configuration is not covered in this guide. The Openshift Router solution works great for exposing applications that have a small number of TCP ports on each VM running the application (less than 10) that they are interested in exposing on an ingress endpoint.</p><h3>MetalLB Load Balancer + IPVS solution</h3><p>MetalLB with IPVS is a great solution when the VM applications need to expose a large range of both TCP and UDP ports through a central ingress endpoint. WebRTC is an example application that has these characteristics. In this setup: we provision a load balancer service with MetalLB and run the speaker pod(s) on nodes that are in the same L2 network as the backing VM applications. Additionally on these nodes: a daemonset is deployed that will periodically reconcile IPVS and iptable rules which will NAT the traffic from the load balancer VIP to the backing VM applications. This guide assumes MetalLB is already installed and has been configured with floating ips that it can assign to load balancer services (for details on the install consult <a href="https://docs.openshift.com/container-platform/4.9/networking/metallb/about-metallb.html">Openshift’s documentation</a>). We will now apply the configuration to configure the MetalLB service and the daemonset that will reconcile the IPVS and iptable rules (config shown below):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/558dad5d2cc937d2e6013664fbfdd1dc/href">https://medium.com/media/558dad5d2cc937d2e6013664fbfdd1dc/href</a></iframe><pre>$ kubectl get service -n tyler-vm app-1</pre><pre>NAME              TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)          AGE</pre><pre>app-1   LoadBalancer   172.21.107.166   10.240.0.4   2041:30605/TCP   6d10h</pre><p>At this point the floating IP is registered and being advertised by the MetalLB speaker pods. On each of the nodes running MetalLB speaker pods: the IPVS daemoneset is going to lay down the following rule set</p><pre>ipvsadm -A -f 1  -s rr<br>ipvsadm -a -f 1 -r 10.240.64.8 -m<br><br><br>iptables  -A PREROUTING -t mangle -d 10.240.0.4/32 -p udp --dport 40000:65535  -j MARK --set-mark 1<br>iptables  -A PREROUTING -t mangle -d 10.240.0.4/32 -p tcp --dport 40000:65535  -j MARK --set-mark 1<br>iptables  -A PREROUTING -t mangle -d 10.240.0.4/32 -p tcp --dport 8000  -j MARK --set-mark 1</pre><pre>sysctl -w net.ipv4.vs.conntrack=1<br>ip addr add 10.240.0.4 brd 10.240.0.4 scope host dev lo</pre><p>This automation sets up the IPVS NAT service that will ultimately forward ports 40000–65535 TCP+UDP and port 8000 TCP to the backend VM application at 10.240.64.8. Using this solution: we are able to forward a much larger port range than Kubernetes/Openshift allows by default in it’s service definitions. To properly integrate the backend VM with IPVS NAT: the default route of the backend VM needs to be set to be via the “ingress node” that is processing the traffic. This is done with the following automation:</p><pre>root@tyler-vm-1:~# ip route add default via 10.240.0.4 dev ens3</pre><p>With that in place: we can now send traffic from the MetalLB floating IP into the backing VM application</p><pre>$  curl <a href="http://10.240.64.8:8000/">http://10.240.64.8:8000</a><br>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;<br>&lt;title&gt;Directory listing for /&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;h1&gt;Directory listing for /&lt;/h1&gt;<br>&lt;hr&gt;<br>&lt;ul&gt;<br>&lt;li&gt;&lt;a href=&quot;.bashrc&quot;&gt;.bashrc&lt;/a&gt;&lt;/li&gt;<br>&lt;li&gt;&lt;a href=&quot;.cache/&quot;&gt;.cache/&lt;/a&gt;&lt;/li&gt;<br>&lt;li&gt;&lt;a href=&quot;.profile&quot;&gt;.profile&lt;/a&gt;&lt;/li&gt;<br>&lt;li&gt;&lt;a href=&quot;.ssh/&quot;&gt;.ssh/&lt;/a&gt;&lt;/li&gt;<br>&lt;li&gt;&lt;a href=&quot;snap/&quot;&gt;snap/&lt;/a&gt;&lt;/li&gt;<br>&lt;/ul&gt;<br>&lt;hr&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>This guide will only show traffic being sent to port 8000 however the additional range of 40000–65535 will also be forwarded in the same fashion. This is a useful configuration when applications need to expose large port ranges using multiple protocols (TCP+UDP) and the environment is compatible with MetalLB deployments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0a14aec535c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accessing IBM Cloud Satellite Services from a Restricted Client Network Using HTTP Proxies]]></title>
            <link>https://lisowski0925.medium.com/accessing-ibm-cloud-satellite-services-from-a-restricted-client-network-using-http-proxies-b3ef35170231?source=rss-846da30431d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3ef35170231</guid>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[hybrid-cloud]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[banking]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Tyler Lisowski]]></dc:creator>
            <pubDate>Tue, 06 Sep 2022 16:51:25 GMT</pubDate>
            <atom:updated>2022-09-06T16:52:16.774Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QqlSPPgWoSX4DsR-1_jcLQ.png" /><figcaption>Accessing IBM Cloud Satellite Services from a Restricted Client Network Using HTTP Proxies</figcaption></figure><p>Clients interested in consuming IBM Cloud Satellite Services can reside in a restricted network environment both from a IP connectivity and DNS resolution perspective. In these environments: clients often cannot resolve IBM Cloud Satellite specific domains including cluster ingress domains and location domains. Additionally: these clients do not have direct access to the networks running the IBM Cloud Satellite Services. In these environments: HTTP proxies can provide an access controlled way for clients from a restricted network to connect to the IBM Cloud Satellite Services. This guide walks through accessing the Openshift Console of a ROKS on Satellite cluster within a VPC to clients using Squid as the HTTP proxy.</p><p>We start with a IBM Cloud Satellite and ROKS on Satellite cluster deployed in a private VPC. The example environment details are shown below:</p><pre>tylerlisowski$ ibmcloud sat hosts --location tyler-loc-useast<br>Retrieving hosts...<br><strong>OK<br>Name</strong>                <strong>ID</strong>                     <strong>State</strong>      <strong>Status</strong>   <strong>Zone</strong>        <strong>Cluster</strong>                <strong>Worker ID</strong>                                                 <strong>Worker IP<br>tyler-testtest-1</strong>    152f156d75c032fd4b05   assigned   Ready    us-east-1   infrastructure         sat-tylertestt-f942e3a4fee94f29be06081424dad00c0a4e62ab   10.240.0.76<br><strong>tyler-testtest-11</strong>   b9a5a03e7261221bf65a   assigned   Ready    us-east-1   infrastructure         sat-tylertestt-6909322966b8d8eb10fc45a0299852dead5a1591   10.240.0.21<br><strong>tyler-testtest-12</strong>   41794a98a9b3db902c6d   assigned   Ready    us-east-2   infrastructure         sat-tylertestt-c29a0fff49a7d710fc943222513f490c11246c04   10.240.0.22<br><strong>tyler-testtest-13</strong>   4dcc290c9dbed1ab4a3c   assigned   Ready    us-east-3   infrastructure         sat-tylertestt-a94a00c0088445306913c08aae2212b064fb3c22   10.240.0.23<br><strong>tyler-testtest-2</strong>    787058c8d516a74131f7   assigned   Ready    us-east-3   infrastructure         sat-tylertestt-d72e5734ed6199b4e0ff223c6335e349ea39226a   10.240.0.77<br><strong>tyler-testtest-3</strong>    3d13d3e4aaea788ce3e7   assigned   Ready    us-east-2   infrastructure         sat-tylertestt-84999d4c14c83044ea3b4e418e4badfd677b5f20   10.240.0.78<br><strong>tyler-testtest-8</strong>    48d0ebbbdd4eb0b8a24c   assigned   Ready    us-east-1   tyler-loc-useast-d-1   sat-tylertestt-6b232b18eb144361d0f27011b7f2eec52e43b802   10.240.0.19<br><strong>tyler-testtest-9</strong>    1f199aacadbc702e36d8   assigned   Ready    us-east-1   tyler-loc-useast-d-1   sat-tylertestt-c50eabbf3519e3bed71206765a1a4784ac3c2d2e   10.240.0.20</pre><pre>tylerlisowski$ ibmcloud cs cluster get --cluster tyler-loc-useast-d-1<br>Retrieving cluster <strong>tyler-loc-useast-d-1</strong>...<br><strong>OK</strong></pre><pre><strong>Name:</strong>                           tyler-loc-useast-d-1<br><strong>ID:</strong>                             cbqg0h3w0scd7l9mc6gg<br><strong>State:</strong>                          normal<br><strong>Status:</strong>                         All Workers Normal<br><strong>Created:</strong>                        2022-08-11 08:12:36 -0500 (3 weeks ago)<br><strong>Pod Subnet:</strong>                     172.30.0.0/16<br><strong>Service Subnet:</strong>                 172.21.0.0/16<br><strong>Workers:</strong>                        2<br><strong>Worker Zones:</strong>                   us-east-1<br><strong>Ingress Subdomain:</strong>              tyler-loc-useast-d-1-80d128fecd199542426020c17e5e9430-0000.us-east.containers.appdomain.cloud<br><strong>Public Service Endpoint URL:</strong>    <a href="https://c-01.private.us-east.link.satellite.cloud.ibm.com:32915/">https://c-01.private.us-east.link.satellite.cloud.ibm.com:32915</a><br><strong>Private Service Endpoint URL:</strong>   https://t80bc734cb074c8b16595-6b64a6ccc9c596bf59a86625d8fa2202-ce00.us-east.satellite.appdomain.cloud:30617</pre><pre><strong>Master<br>Status:</strong>     Ready (4 days ago)<br><strong>State:</strong>      deployed<br><strong>Health:</strong>     normal<br><strong>Version:</strong>    4.11.0_1521_openshift<br><strong>Location:</strong>   tyler-loc-useast<br><strong>URL:</strong>        https://t80bc734cb074c8b16595-6b64a6ccc9c596bf59a86625d8fa2202-ce00.us-east.satellite.appdomain.cloud:30617</pre><p>The infrastructure in this private VPC that make up the Satellite Location and run the Satellite Services are not accessible from my client network. This can be seen when I try to access the Openshift Console without any proxy configuration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ko-m3BWilREY_rC-c1rAPQ.png" /></figure><p>We will now proceed to provision and run an HTTP proxy using Squid. Squid will be ran on a machine that can be accessed by the clients in the restricted network and can send traffic to the infrastructure running the Satellite Services. Installing and configuring squid on a RHEL 8 machine is shown below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/29beb5bd92338a579bff9c03e09c0e66/href">https://medium.com/media/29beb5bd92338a579bff9c03e09c0e66/href</a></iframe><p>With the proxy activated and in place: we can generate a proxy auto configuration file that can be used to configure a browser to send all traffic to the HTTP proxy. The file for my example environment is shown below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa38a0ed16ad149dc512460024df29b8/href">https://medium.com/media/aa38a0ed16ad149dc512460024df29b8/href</a></iframe><p>The key piece to note is the IP address of the proxy (169.63.190.35) is accessible from my restricted client network. With this configuration in place: all client HTTP/HTTPS requests will be sent to the proxy. The proxy will handle resolving the DNS name in the request and ultimately proxying that connection to the appropriate backend. All that is required by the client is it must be able to resolve the DNS of the HTTP proxy machine(s) (if applicable) and have IP connectivity to the machine(s) running the proxy.</p><p>The proxy configuration can be loaded into Firefox using the preferences page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Z4KWOCHGQtSJX1B5iaNVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*ie7UIC4aHut-GZVk9YFurw.png" /></figure><p>With the configuration loaded and in place: we can now access the Openshift Console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c8RqbSGSIMnllLxn8QO-hw.png" /></figure><p>Additionally: we can also access the ROKS Apiserver with kubectl/oc using the HTTP proxy as well</p><pre>Tylers-MacBook-Pro:~ tylerlisowski$ export HTTPS_PROXY=&quot;http://169.63.190.35:3128&quot;<br>Tylers-MacBook-Pro:~ tylerlisowski$ bx cs cluster config --cluster tyler-loc-useast-d-1 --admin<br><strong>OK<br></strong>The configuration for <strong>tyler-loc-useast-d-1</strong> was downloaded successfully.<br>Added context for <strong>tyler-loc-useast-d-1</strong> to the current kubeconfig file.<br>You can now execute &#39;<strong>kubectl</strong>&#39; commands against your cluster. For example, run &#39;<strong>kubectl get nodes</strong>&#39;.<br>If you are accessing the cluster for the first time, &#39;<strong>kubectl</strong>&#39; commands might fail for a few seconds while RBAC synchronizes.</pre><pre>Tylers-MacBook-Pro:~ tylerlisowski$ kubectl get node<br>NAME               STATUS   ROLES           AGE     VERSION<br>tyler-testtest-8   Ready    master,worker   3d18h   v1.24.0+4f0dd4d<br>tyler-testtest-9   Ready    master,worker   3d18h   v1.24.0+4f0dd4d</pre><p>Any HTTP/HTTPS services within the location can be accessed in a similar manner. This guide configured basic IP based access controls in squid but it did not configure any domain allowlisting from a squid perspective. <a href="http://www.squid-cache.org/Doc/config/">Squid’s configuration</a> can be consulted for more advanced configurations that introduce domain allowlisting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3ef35170231" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Kubernetes Certificate Signing Requests and RBAC for User Authentication and Authorization]]></title>
            <link>https://lisowski0925.medium.com/using-kubernetes-csrs-and-rbac-for-cluster-user-authentication-and-authorization-9df5498655cd?source=rss-846da30431d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9df5498655cd</guid>
            <category><![CDATA[identity]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[authorization]]></category>
            <dc:creator><![CDATA[Tyler Lisowski]]></dc:creator>
            <pubDate>Wed, 22 Jun 2022 18:33:53 GMT</pubDate>
            <atom:updated>2022-06-23T02:15:52.141Z</atom:updated>
            <content:encoded><![CDATA[<p>There is a need in Kubernetes environments without a backend identity provider for a form of automated user management. Typically there are two strategies for provisioning user identities without utilizing a backing identity provider: Service Account Tokens and Kubernetes Certificate Signing Requests. This guide will walk through how Kubernetes Certificate Signing Requests can be utilized to distribute certificates that associate a user with a unique identity that can then be assigned access to a Kubernetes cluster with RBAC.</p><p>Kubernetes uses <a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/#x509-client-certs">well defined fields in X509 certs</a> that are signed by the Kubernetes Cluster CA to associate a given request with a user identity. The <em>Common Name</em> of the certificate maps to the user name of the request. The <em>Organization</em> fields in the certificate defines the group memberships of the user. Using the Kubernetes Certificate Signing Request API: certificates can be requested dynamically and if approved the user of the certificate will be associated with the values of the fields in the certificate. We can illustrate this strategy by provisioning an identity for an SRE and a Development member for a sample organization. The SRE member and Development member will have different levels of access: in our example each will be assigned access to a unique namespace.</p><p>The first step of the process is defining the private key and associated certificate signing request of that key that will be sent to the Kubernetes cluster for approval. We will use cfssl to generate these artifacts and the commands are shown below:</p><pre>cat &lt;&lt;<strong>EOF </strong>&gt;/tmp/sre-csr.json<br>{<br>  &quot;CN&quot;: &quot;myorg-sre-1&quot;,<br>  &quot;hosts&quot;: [<br>  ],<br>  &quot;key&quot;: {<br>    &quot;algo&quot;: &quot;rsa&quot;,<br>    &quot;size&quot;: 2048<br>  },<br>  &quot;names&quot;: [<br>    {<br>      &quot;O&quot;: &quot;myorg-sre&quot;<br>    }<br>  ]<br>}<br><strong>EOF<br></strong>cat &lt;&lt;<strong>EOF </strong>&gt;/tmp/dev-csr.json<br>{<br>  &quot;CN&quot;: &quot;myorg-dev-1&quot;,<br>  &quot;hosts&quot;: [<br>  ],<br>  &quot;key&quot;: {<br>    &quot;algo&quot;: &quot;rsa&quot;,<br>    &quot;size&quot;: 2048<br>  },<br>  &quot;names&quot;: [<br>    {<br>      &quot;O&quot;: &quot;myorg-dev&quot;<br>    }<br>  ]<br>}<br><strong>EOF<br></strong>rm -rf /tmp/csr-dir<br>mkdir -p /tmp/csr-dir<br>set -o pipefail<br>cd /tmp/csr-dir || exit 1<br>cfssl genkey /tmp/sre-csr.json | cfssljson -bare sre<br>cfssl genkey /tmp/dev-csr.json | cfssljson -bare dev<br>DEV_CSR_CONTENT_64=$(cat dev.csr | base64 -w 0)<br>SRE_CSR_CONTENT_64=$(cat sre.csr | base64 -w 0)</pre><p>At the end of the automation: there will be a key/certificate signing request pair for both the SRE member and the Development member. With these artifacts generated: the certificate signing requests can be sent to the Kubernetes apiserver:</p><pre>cat &lt;&lt;<strong>EOF </strong>&gt;/tmp/kube-csr-dev.yaml<br>apiVersion: certificates.k8s.io/v1<br>kind: CertificateSigningRequest<br>metadata:<br>  name: myorg-dev-1<br>spec:<br>  request: $DEV_CSR_CONTENT_64<br>  signerName: kubernetes.io/kube-apiserver-client<br>  usages:<br>  - client auth<br><strong>EOF<br></strong>cat &lt;&lt;<strong>EOF </strong>&gt;/tmp/kube-csr-sre.yaml<br>apiVersion: certificates.k8s.io/v1<br>kind: CertificateSigningRequest<br>metadata:<br>  name: myorg-sre-1<br>spec:<br>  request: $SRE_CSR_CONTENT_64<br>  signerName: kubernetes.io/kube-apiserver-client<br>  usages:<br>  - client auth<br><strong>EOF<br></strong>kubectl apply -f /tmp/kube-csr-sre.yaml<br>kubectl apply -f /tmp/kube-csr-dev.yaml<br>kubectl get csr</pre><pre>NAME          AGE   SIGNERNAME                            REQUESTOR      REQUESTEDDURATION   CONDITION<br>myorg-dev-1   8s    kubernetes.io/kube-apiserver-client   system:admin   &lt;none&gt;              Pending<br>myorg-sre-1   9s    kubernetes.io/kube-apiserver-client   system:admin   &lt;none&gt;              Pending</pre><p>When the CertificateSigningRequest instances are applied: the certificate signing requests are now issued to the Kubernetes cluster and are awaiting approval. When approved: a certificate will be issued that is signed by the cluster’s certificate authority which will then issue a cert that the members can utilize in combination with the key tied to the certificate signing request to authenticate to the cluster’s apiserver. The approval is typically performed by a cluster admin and the commands are shown below:</p><pre>kubectl certificate approve myorg-dev-1<br>certificatesigningrequest.certificates.k8s.io/myorg-dev-1 approved</pre><pre>kubectl certificate approve myorg-sre-1<br>certificatesigningrequest.certificates.k8s.io/myorg-sre-1 approved</pre><p>Once approved the base64 encoded signed certificates can then be fetched with the following command</p><pre>DEV_CERTIFICATE_64=$(kubectl get csr myorg-dev-1 -o jsonpath=&#39;{.status.certificate}&#39;)<br>SRE_CERTIFICATE_64=$(kubectl get csr myorg-sre-1 -o jsonpath=&#39;{.status.certificate}&#39;)</pre><p>The key content can be gathered from the key files on the local system that generated the key/certificate signing request pair and base64 encoded with the following:</p><pre>DEV_KEY_CONTENT_64=$(cat /tmp/csr-dir/dev-key.pem | base64 -w 0)<br>SRE_KEY_CONTENT_64=$(cat /tmp/csr-dir/sre-key.pem | base64 -w 0)</pre><p>Using those values: kubeconfigs can be generated for each identity with the following commands (the kube-apiserver address is a well known address that is input to the automation and can be found by looking at the kubeconfig that was originally used to create the CSRs):</p><pre>#example apiserver endpoint: <a href="https://c100-e.us-east.containers.cloud.ibm.com:31581/">https://c100-e.us-<br>east.containers.cloud.ibm.com:31581</a><br>APISERVER_ENDPOINT=https://my-api-server-address:my-api-port<br>cat &lt;&lt;<strong>EOF </strong>&gt;/tmp/sre.kubeconfig<br>apiVersion: v1<br>clusters:<br>- cluster:<br>    server: $APISERVER_ENDPOINT<br>  name: mycluster<br>contexts:<br>- context:<br>    cluster: mycluster<br>    namespace: default<br>    user: sre/mycluster<br>  name: mycluster/sre<br>current-context: mycluster/sre<br>kind: Config<br>preferences: {}<br>users:<br>- name: sre/mycluster<br>  user:<br>    client-certificate-data: $SRE_CERTIFICATE_64<br>    client-key-data: $SRE_KEY_CONTENT_64<br><strong>EOF<br></strong>cat &lt;&lt;<strong>EOF </strong>&gt;/tmp/dev.kubeconfig<br>apiVersion: v1<br>clusters:<br>- cluster:<br>    server: $APISERVER_ENDPOINT<br>  name: mycluster<br>contexts:<br>- context:<br>    cluster: mycluster<br>    namespace: default<br>    user: dev/mycluster<br>  name: mycluster/dev<br>current-context: mycluster/dev<br>kind: Config<br>preferences: {}<br>users:<br>- name: dev/mycluster<br>  user:<br>    client-certificate-data: $DEV_CERTIFICATE_64<br>    client-key-data: $DEV_KEY_CONTENT_64<br><strong>EOF</strong></pre><p>We can confirm we are properly authenticating to the apiserver by issuing a request with the generated kubeconfigs:</p><pre>kubectl --kubeconfig /tmp/dev.kubeconfig get node<br>Error from server (Forbidden): nodes is forbidden: User &quot;myorg-dev-1&quot; cannot list resource &quot;nodes&quot; in API group &quot;&quot; at the cluster scope</pre><pre>kubectl --kubeconfig /tmp/sre.kubeconfig get node<br>Error from server (Forbidden): nodes is forbidden: User &quot;myorg-sre-1&quot; cannot list resource &quot;nodes&quot; in API group &quot;&quot; at the cluster scope</pre><p>At this point we now have the authentication information and can make requests as the appropriate identities: we will now assign access to each group to allow it full access to a unique namespace. Dev will get access to the default namespace and SRE will get access to the kube-system namespace. The associated RBAC to accomplish that is shown below:</p><pre>cat &lt;&lt;<strong>EOF </strong>&gt;/tmp/sre-namespace-rbac.yaml<br>apiVersion: rbac.authorization.k8s.io/v1<br>kind: RoleBinding<br>metadata:<br>  name: myorg-sre-team<br>  namespace: kube-system<br>roleRef:<br>  apiGroup: rbac.authorization.k8s.io<br>  kind: Role<br>  name: myorg-sre-team<br>subjects:<br>  - kind: Group<br>    name: myorg-sre<br>---<br>apiVersion: rbac.authorization.k8s.io/v1<br>kind: Role<br>metadata:<br>  name: myorg-sre-team<br>  namespace: kube-system<br>rules:<br>  - apiGroups:<br>      - &quot;&quot;<br>    resources:<br>      - &quot;*&quot;<br>    verbs:<br>      - &quot;*&quot;<br><strong>EOF<br></strong>cat &lt;&lt;<strong>EOF </strong>&gt;/tmp/dev-namespace-rbac.yaml<br>apiVersion: rbac.authorization.k8s.io/v1<br>kind: RoleBinding<br>metadata:<br>  name: myorg-dev-team<br>  namespace: default<br>roleRef:<br>  apiGroup: rbac.authorization.k8s.io<br>  kind: Role<br>  name: myorg-dev-team<br>subjects:<br>  - kind: Group<br>    name: myorg-dev<br>---<br>apiVersion: rbac.authorization.k8s.io/v1<br>kind: Role<br>metadata:<br>  name: myorg-dev-team<br>  namespace: default<br>rules:<br>  - apiGroups:<br>      - &quot;&quot;<br>    resources:<br>      - &quot;*&quot;<br>    verbs:<br>      - &quot;*&quot;<br><strong>EOF</strong></pre><pre>kubectl apply -f /tmp/dev-namespace-rbac.yaml<br>rolebinding.rbac.authorization.k8s.io/myorg-dev-team created<br>role.rbac.authorization.k8s.io/myorg-dev-team created</pre><pre>kubectl apply -f /tmp/sre-namespace-rbac.yaml<br>rolebinding.rbac.authorization.k8s.io/myorg-sre-team created<br>role.rbac.authorization.k8s.io/myorg-sre-team created</pre><p>When that RBAC is created: we can now show that Development can access resources in the default namespace but not kube-system:</p><pre>kubectl --kubeconfig /tmp/dev.kubeconfig get pods -n default<br>NAME                                                 READY   STATUS    RESTARTS   AGE<br>prometheus-pushgateway-1597420487-5f6d5c89f9-2m8pt   1/1     Running   0          6h13m<br>ruby-hello-world-67b66d9d69-m7dtr                    1/1     Running   0          6h13m</pre><pre>kubectl --kubeconfig /tmp/dev.kubeconfig get pods -n kube-system<br>Error from server (Forbidden): pods is forbidden: User &quot;myorg-dev-1&quot; cannot list resource &quot;pods&quot; in API group &quot;&quot; in the namespace &quot;kube-system&quot;</pre><p>Additionally, we can show that SRE can access resources in the kube-system namespace but not the default namespace:</p><pre>kubectl --kubeconfig /tmp/sre.kubeconfig get pods -n kube-system</pre><pre>NAME                                        READY   STATUS    RESTARTS   AGE<br>ibm-keepalived-watcher-ksp6s                1/1     Running   0          6h5m<br>ibm-keepalived-watcher-lmb2z                1/1     Running   0          6h4m<br>ibm-keepalived-watcher-wq6ll                1/1     Running   0          6h5m<br>ibm-master-proxy-static-10.240.0.12         2/2     Running   0          6h3m<br>ibm-master-proxy-static-10.240.0.13         2/2     Running   0          6h4m<br>ibm-master-proxy-static-10.240.0.14         2/2     Running   0          6h4m<br>ibm-storage-metrics-agent-b44665c75-mxcj4   1/1     Running   0          5h3m<br>ibm-vpc-block-csi-controller-0              4/4     Running   0          6h18m<br>ibm-vpc-block-csi-node-km9fv                3/3     Running   0          6h5m<br>ibm-vpc-block-csi-node-qbk26                3/3     Running   0          6h5m<br>ibm-vpc-block-csi-node-x4bzh                3/3     Running   0          6h4m<br>vpn-77577d6bb9-jx28d                        1/1     Running   0          5h56m</pre><pre>kubectl --kubeconfig /tmp/sre.kubeconfig get pods -n default</pre><pre>Error from server (Forbidden): pods is forbidden: User &quot;myorg-sre-1&quot; cannot list resource &quot;pods&quot; in API group &quot;&quot; in the namespace &quot;default&quot;</pre><p>Congratulations! At this point you have successfully setup two unique identities using Kubernetes Certificate Signing Requests!</p><p>The certificates will have a duration that corresponds to either the configured certificate signing duration in the kube controller manager (default is a year) or to the value specified in the CSR request if applicable. Additionally: if an exposure of that cert happens before the end of the duration: CA rotation can be performed on a cluster to rotate CAs and revoke the certs from being able to authenticate to the APIServer. RBAC can also be revoked for the exposed identity by deleting the role bindings/cluster role bindings that grant authorization to the identities associated with the certificate. Certificates can be renewed by issuing another CSR request to the Kubernetes apiserver at the desired time for renewal.</p><h3>Fully Automated Steps</h3><p>Below is a script that automates all the steps walked through above and will result in the creation of the Development and SRE kubeconfig. The following prereqs must be met before running the automation:</p><p><strong>Prerequisites:<br>- Ensure the url for the Kubernetes apiserver is set in variable </strong><em>APISERVER_ENDPOINT</em> <br>- Ensure an admin kubeconfig is set as the active kubeconfig for the appropriate cluster before running the automation<br>- Ensure cfssl and cfssljson are downloaded and properly exposed in the system path</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6f906ea6d203e820bf6370f1d918160e/href">https://medium.com/media/6f906ea6d203e820bf6370f1d918160e/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9df5498655cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>