<?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 Robert Najarian on Medium]]></title>
        <description><![CDATA[Stories by Robert Najarian on Medium]]></description>
        <link>https://medium.com/@a.najarian?source=rss-410b876fc461------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*74_DJzDkXKle4s6ESNLrZA.jpeg</url>
            <title>Stories by Robert Najarian on Medium</title>
            <link>https://medium.com/@a.najarian?source=rss-410b876fc461------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:21:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@a.najarian/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[Securing the Future: How Cisco AI Defense is Revolutionizing Enterprise AI Security]]></title>
            <link>https://medium.com/@a.najarian/securing-the-future-how-cisco-ai-defense-is-revolutionizing-enterprise-ai-security-3356ab7f23b7?source=rss-410b876fc461------2</link>
            <guid isPermaLink="false">https://medium.com/p/3356ab7f23b7</guid>
            <dc:creator><![CDATA[Robert Najarian]]></dc:creator>
            <pubDate>Wed, 22 Jan 2025 19:23:19 GMT</pubDate>
            <atom:updated>2025-01-22T19:23:19.578Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I6GlLzeJyhN0Y3cw0Pw3Vw.jpeg" /></figure><p>As artificial intelligence (AI) continues to reshape industries and accelerate digital transformation, it has also become a prime target for sophisticated cyber threats. From adversarial attacks to data leakage, the risks associated with AI-driven applications are evolving as fast as the technology itself. Enter <strong>Cisco AI Defense</strong>, a comprehensive solution designed to secure enterprises in the age of AI.</p><p>Announced in January 2025, Cisco AI Defense marks a critical leap forward in addressing the unique challenges posed by AI. Leveraging Cisco’s decades of expertise in cybersecurity and network visibility, this solution provides a robust defense against threats while ensuring seamless integration into existing enterprise systems. Let’s dive into what makes Cisco AI Defense a game-changer.</p><h4><strong>The Building Blocks of Cisco AI Defense</strong></h4><p>Cisco AI Defense is not just a collection of tools; it’s a complete ecosystem designed to safeguard AI at every stage of its lifecycle. Here are the core components that set it apart:</p><p><strong>1. AI Access</strong></p><p>Organizations are increasingly relying on third-party AI applications, making it imperative to enforce strict data control. AI Access ensures visibility and governance over these applications, employing advanced data-loss prevention measures and threat mitigation protocols to protect sensitive information.</p><p><strong>2. AI Model and Application Validation</strong></p><p>Before deployment, AI models must undergo rigorous assessments to identify vulnerabilities. Cisco’s solution automates this process, detecting risks such as model bias, data poisoning, and security flaws. This proactive approach minimizes potential harm before it reaches production environments.</p><p><strong>3. AI Runtime Protection</strong></p><p>Real-time protection is crucial for AI systems in production. AI Runtime Protection acts as a safeguard, blocking adversarial attacks, mitigating harmful or off-topic responses, and ensuring that AI applications operate within ethical and secure boundaries.</p><p><strong>4. AI Cloud Visibility</strong></p><p>With enterprises increasingly operating in hybrid and multi-cloud environments, tracking AI models and data sources is no small task. AI Cloud Visibility offers automatic inventory management, enabling organizations to monitor AI usage, assess risks, and ensure compliance with regulatory standards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4F0yPuGnSk6Jw6eWCNo0vg.jpeg" /></figure><h4><strong>Why Cisco AI Defense Matters</strong></h4><p>The launch of Cisco AI Defense addresses a growing sense of urgency around AI security. Recent high-profile incidents, including AI model manipulation and data breaches, underscore the need for comprehensive solutions that can adapt to the rapidly shifting threat landscape. Cisco AI Defense meets this need by offering:</p><p>• <strong>Network-Layer Visibility:</strong> Cisco’s unparalleled insights into network traffic enhance its ability to detect and neutralize threats before they escalate.</p><p>• <strong>Standards Alignment:</strong> By adhering to guidelines from NIST, MITRE ATLAS, and OWASP LLM Top 10, Cisco ensures enterprises remain compliant with industry best practices.</p><ul><li><strong>Agentless Deployment:</strong> Unlike many solutions requiring additional software or libraries, Cisco AI Defense integrates seamlessly with existing enterprise infrastructures, reducing deployment complexity.</li></ul><h4><strong>Transforming AI Security Across Industries</strong></h4><p>Cisco AI Defense is poised to benefit a wide range of sectors, from finance and healthcare to manufacturing and retail. For instance:</p><p>• <strong>Financial Services:</strong> Protecting AI-driven fraud detection systems from adversarial attacks ensures the integrity of sensitive customer transactions.</p><p>• <strong>Healthcare:</strong> Safeguarding AI-based diagnostics tools prevents tampering that could endanger patient care.</p><ul><li><strong>Retail:</strong> Securing recommendation engines and customer data enhances trust in AI-powered personalization.</li></ul><h4><strong>Looking Ahead: A Safer AI-Driven Future</strong></h4><p>As AI becomes increasingly central to business operations, its security can no longer be an afterthought. Cisco AI Defense represents a vital step forward in ensuring that enterprises can harness the power of AI without compromising on safety or ethics.</p><p>By combining cutting-edge technology, seamless integration, and adherence to global standards, Cisco AI Defense empowers organizations to stay one step ahead of evolving threats. It’s not just about protecting systems — it’s about building trust in the future of AI.</p><p>References:</p><ul><li><a href="https://newsroom.cisco.com/c/r/newsroom/en/us/a/y2025/m01/cisco-unveils-ai-defense-to-secure-the-ai-transformation-of-enterprises.html?utm_source=chatgpt.com">Cisco Unveils AI Defense to Secure the AI Transformation of Enterprises</a></li><li><a href="https://www.cisco.com/site/us/en/products/security/ai-defense/index.html?utm_source=chatgpt.com">Cisco AI Defense</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3356ab7f23b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking Down EKS Networking Parameters on AWS: WARM_ENI_TARGET, WARM_IP_TARGET, and…]]></title>
            <link>https://medium.com/@a.najarian/breaking-down-eks-networking-parameters-on-aws-warm-eni-target-warm-ip-target-and-8f2231336bc8?source=rss-410b876fc461------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f2231336bc8</guid>
            <dc:creator><![CDATA[Robert Najarian]]></dc:creator>
            <pubDate>Tue, 14 Jan 2025 16:41:16 GMT</pubDate>
            <atom:updated>2025-01-14T16:41:16.745Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Breaking Down EKS Networking Parameters on AWS: WARM_ENI_TARGET, WARM_IP_TARGET, and MINIMUM_IP_TARGET</strong></h3><p>(How to use EKS Subnet IP Usage Calculator)</p><p>Amazon Elastic Kubernetes Service (EKS) is a robust managed Kubernetes offering, streamlining cluster management in the AWS ecosystem. However, when it comes to networking in EKS, the nuances of Elastic Network Interfaces (ENIs) and IP allocation can be a source of confusion. Parameters such as WARM_ENI_TARGET, WARM_IP_TARGET, and MINIMUM_IP_TARGET play a crucial role in optimizing resource utilization, latency, and cost in your Kubernetes cluster.</p><p>In this article, we’ll demystify these parameters, explain their purpose, and help you determine how to configure them effectively for your workloads.</p><p><strong>Understanding ENIs and Pod Networking in EKS</strong></p><p>Each EKS worker node is associated with one or more ENIs, which are virtual network interfaces in your Amazon VPC. ENIs are responsible for providing IP addresses for Kubernetes pods. Depending on the instance type, each ENI can support a fixed number of secondary IP addresses.</p><p>This creates a direct relationship between ENI provisioning, IP addresses, and pod scalability in your cluster. Mismanaging these resources can lead to performance bottlenecks, increased costs, or even pod scheduling failures.</p><p><strong>Key Networking Parameters: A Closer Look</strong></p><p><strong>1. WARM_ENI_TARGET</strong></p><p>The WARM_ENI_TARGET parameter specifies the number of free, pre-allocated ENIs that the amazon-vpc-cni plugin will maintain per node.</p><p>• <strong>Purpose</strong>:</p><p>Keeping a buffer of pre-allocated ENIs minimizes the time required to attach a new ENI when additional pods are scheduled.</p><p>• <strong>Use Case</strong>:</p><p>This is beneficial in clusters with dynamic scaling, where pods are frequently scheduled or terminated.</p><p>• <strong>Default Behavior</strong>:</p><p>By default, the WARM_ENI_TARGET is set to 1. This means each node will always have one unused ENI ready for immediate allocation.</p><p><strong>2. WARM_IP_TARGET</strong></p><p>The WARM_IP_TARGET parameter specifies the desired number of unused IP addresses that should always be available on a node.</p><p>• <strong>Purpose</strong>:</p><p>Ensuring a buffer of IP addresses reduces latency during pod creation since an IP address can be immediately assigned without waiting for a new ENI or IP allocation.</p><p>• <strong>Use Case</strong>:</p><p>Ideal for clusters with predictable or bursty traffic patterns where IP address allocation speed is critical.</p><p>• <strong>Default Behavior</strong>:</p><p>The default value is unset, meaning the cluster relies on WARM_ENI_TARGET to determine IP allocation. Setting this parameter overrides WARM_ENI_TARGET’s behavior.</p><p><strong>3. MINIMUM_IP_TARGET</strong></p><p>The MINIMUM_IP_TARGET parameter ensures that each node has a minimum number of IP addresses allocated, irrespective of pod scheduling requirements.</p><p>• <strong>Purpose</strong>:</p><p>This parameter guarantees that nodes are pre-allocated with a baseline number of IP addresses, ensuring predictable performance for workloads with a known, consistent IP demand.</p><p>• <strong>Use Case</strong>:</p><p>Useful in environments where pods are rarely created or deleted, and maintaining a stable IP pool is a higher priority than scaling dynamically.</p><p>• <strong>Default Behavior</strong>:</p><p>The default is unset, and this parameter is typically used in tandem with the other two for finer control over IP allocation.</p><p><strong>How These Parameters Interact</strong></p><p>Understanding the interaction between these parameters is crucial for fine-tuning your cluster:</p><p>1. WARM_ENI_TARGET<strong> vs. </strong>WARM_IP_TARGET<strong>:</strong></p><p>If both are set, WARM_IP_TARGET takes precedence. This means the node allocates ENIs and IPs based on the desired number of free IPs rather than the number of free ENIs.</p><p>2. WARM_IP_TARGET<strong> and </strong>MINIMUM_IP_TARGET<strong>:</strong></p><p>While WARM_IP_TARGET focuses on maintaining free IPs for dynamic scaling, MINIMUM_IP_TARGET enforces a baseline allocation, ensuring nodes start with a certain number of IPs, even before scaling needs arise.</p><p>3. <strong>Performance Impact:</strong></p><p>Overprovisioning ENIs or IP addresses can lead to unnecessary resource usage and increased costs. Conversely, underprovisioning can result in scheduling delays or even pod failures.</p><h3><strong>Best Practices for Configuring EKS Networking Parameters</strong></h3><p>1. <strong>Assess Workload Behavior:</strong></p><p>• Use WARM_IP_TARGET for workloads with spiky traffic.</p><p>• Rely on MINIMUM_IP_TARGET for stable, consistent workloads.</p><p>2. <strong>Monitor and Optimize:</strong></p><p>Use CloudWatch metrics and logs from the amazon-vpc-cni plugin to monitor IP and ENI utilization. Adjust parameters based on observed trends.</p><p>3. <strong>Balance Cost and Performance:</strong></p><p>Avoid overprovisioning. Instead, find a balance between ensuring fast pod startup times and minimizing resource waste.</p><p>4. <strong>Test in Non-Production:</strong></p><p>Always validate changes in a staging or development environment to assess their impact on performance and costs.</p><h3><strong>How to use EKS Subnet IP Usage Calculator</strong></h3><p>The <strong>EKS Subnet IP Usage Calculator</strong> is a tool to help you estimate and allocate IP address usage for your <strong>Amazon Elastic Kubernetes Service (EKS)</strong> clusters. Here’s a step-by-step guide on how to use it effectively:</p><p><strong>1. Understand Your Requirements</strong></p><p>Before using the calculator, gather these details about your EKS setup:</p><p>• <strong>Node Groups</strong>: The number and size of the node groups in your cluster.</p><p>• <strong>Pod Density</strong>: The expected number of pods per node.</p><p>• <strong>Subnet Details</strong>: CIDR blocks and subnet sizes in your VPC.</p><p><strong>IP Addressing Mode</strong>: Are you using IPv4 or IPv6?</p><p><strong>2. Open the Calculator</strong></p><p>Some tools are available online as spreadsheets or integrated into AWS documentation. Download or access an online version if needed.</p><p><strong>3. Input Your Cluster Details</strong></p><p>Provide the following key details in the calculator:</p><p><strong>Node Groups</strong></p><p>• <strong>Number of Nodes</strong>: Total nodes in each node group.</p><p>• <strong>Instance Types</strong>: Specify the EC2 instance types, as these determine the number of pods that can run per node.</p><p><strong>Pod Networking</strong></p><p>• <strong>Pod IPs per Node</strong>: Enter the maximum number of pods per node, based on the instance type.</p><p><strong>Subnet Configuration</strong></p><p>• <strong>Subnet CIDR Blocks</strong>: Provide details for each subnet used in the cluster.</p><ul><li><strong>Number of Subnets</strong>: The total subnets available for the EKS cluster.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uf9cykceC5gAOsITWfy0hQ.png" /></figure><p>Question: You need to how many IPs will support via current EC2?</p><p>then simpliy you can run this command on the EC2:</p><pre># aws ec2 describe-instance-types --query &quot;InstanceTypes[?InstanceType==&#39;&lt;instance-type&gt;&#39;].NetworkInfo&quot; --output table<br>&quot;Replace &lt;instance-type&gt; with the actual instance type (e.g., t2.micro).&quot;</pre><h3><strong>Conclusion</strong></h3><p>Networking parameters like WARM_ENI_TARGET, WARM_IP_TARGET, and MINIMUM_IP_TARGET provide powerful levers for optimizing Kubernetes pod networking in EKS. By understanding their purposes and interactions, you can ensure your cluster is well-equipped to handle dynamic workloads, avoid bottlenecks, and maintain cost efficiency.</p><p>Take time to monitor, analyze, and adjust these parameters to suit your specific needs — and watch your EKS cluster thrive.</p><p><em>What challenges have you faced with EKS networking? Let us know in the comments below!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f2231336bc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Deploy Batfish on Kubernetes with Helm and GitLab CI/CD Pipeline]]></title>
            <link>https://medium.com/@a.najarian/how-to-deploy-batfish-on-kubernetes-with-helm-and-gitlab-ci-cd-pipeline-5236da996956?source=rss-410b876fc461------2</link>
            <guid isPermaLink="false">https://medium.com/p/5236da996956</guid>
            <category><![CDATA[batfish]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[network-analysis]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Robert Najarian]]></dc:creator>
            <pubDate>Sun, 17 Nov 2024 11:51:05 GMT</pubDate>
            <atom:updated>2024-11-18T08:11:06.860Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nbcC1i8qKewVpjfnPZMeuA.png" /></figure><p><strong>Batfish</strong> is a powerful network validation and analysis tool that allows engineers to simulate network configurations, identify errors, and verify changes before applying them. Running Batfish on Kubernetes ensures scalability and modern orchestration, while Helm simplifies the deployment and management process. This guide explains how to deploy Batfish on Kubernetes using Helm and automate the process with a CI/CD pipeline.</p><h4><strong>What is Kubernetes?</strong></h4><p>Kubernetes (often abbreviated as K8s) is an open-source platform designed to automate the deployment, scaling, and management of containerized applications. Kubernetes provides several key features:</p><p>• <strong>Self-Healing</strong>: Automatically restarts failed containers and replaces unhealthy nodes.</p><p>• <strong>Scaling</strong>: Adjusts the number of running containers based on demand.</p><p>• <strong>Load Balancing</strong>: Distributes incoming network traffic across multiple pods to ensure high availability.</p><p>• <strong>Declarative Configuration</strong>: Uses YAML or JSON files to define desired application states.</p><p>For teams running modern cloud-native applications, Kubernetes is the backbone for deploying and managing distributed systems efficiently.</p><h4><strong>What is Helm?</strong></h4><p>Helm is a package manager for Kubernetes. It helps manage Kubernetes applications by providing a standardized way to define, install, and update applications using <strong>Helm Charts</strong>. A <strong>Helm Chart</strong> is a collection of files that describe a set of Kubernetes resources.</p><p>Helm allows you to:</p><p>• <strong>Simplify Deployments</strong>: Package complex applications with reusable and configurable templates.</p><p>• <strong>Parameterize Resources</strong>: Use configuration files (values.yaml) to customize deployments without modifying templates.</p><p><strong>Version Control Deployments</strong>: Manage application versions and roll back updates if needed.</p><h4><strong>Prerequisites</strong></h4><p>Before we begin, make sure you have the following tools installed and configured:</p><p>1. <strong>Kubernetes Cluster</strong>: This could be a local cluster (e.g., Minikube) or a cloud-hosted one (e.g., Amazon EKS, Google GKE, Azure AKS).</p><p>2. <strong>Helm</strong>: Install Helm by following the <a href="https://helm.sh/docs/intro/install/">official Helm installation guide</a>.</p><p>3. <strong>kubectl</strong>: Install kubectl to interact with your Kubernetes cluster.</p><p>4. <strong>CI/CD Platform</strong>: This guide uses GitLab CI/CD, but you can adapt it to other platforms.</p><p>Additionally, ensure you have a <strong>kubeconfig</strong> file to authenticate and access your Kubernetes cluster.</p><h4>Helm Chart</h4><p>In my case, it seems to be the folder containing all the Helm chart components for deploying Batfish on Kubernetes. This includes files like:</p><pre>charts/<br>├── Chart.yaml<br>├── values.yaml<br>├── templates/<br>│   ├── deployment.yaml<br>│   ├── service.yaml<br>│   ├── ingress.yaml<br>│   └── _helpers.tpl</pre><h3><strong>Step 1: Creating a Helm Chart for Batfish</strong></h3><p>To deploy Batfish, we create a Helm chart that defines its Kubernetes resources, such as deployments and services.</p><p><strong>Chart.yaml</strong></p><p>This file defines metadata about the Helm chart:</p><pre>apiVersion: v2<br>name: batfish<br>description: A Helm chart for Kubernetes<br>type: application<br>version: 0.1.0<br>appVersion: &quot;latest&quot;</pre><p><em>Explanation</em><strong><em>:</em></strong></p><ul><li><em>name</em>: The name of the chart, which will be used during the Helm deployment.</li></ul><p>• <em>type</em>: Specifies that this is an application chart (not a library chart).</p><p>• <em>version</em>: The Helm chart version, which follows semantic versioning.</p><p>• <em>appVersion</em>: Specifies the version of the Batfish application (e.g., latest).</p><p><strong>values.yaml</strong></p><p>This file defines customizable configurations for the deployment:</p><pre># Default values for batfish.<br># This is a YAML-formatted file.<br># Declare variables to be passed into your templates.<br><br>replicaCount: 1<br><br>image:<br>  repository: batfish/allinone<br>  pullPolicy: IfNotPresent<br>  # Overrides the image tag whose default is the chart appVersion.<br>  tag: latest<br><br>imagePullSecrets: []<br>nameOverride: &quot;&quot;<br>fullnameOverride: &quot;&quot;<br><br>serviceAccount:<br>  # Specifies whether a service account should be created<br>  create: true<br>  # Automatically mount a ServiceAccount&#39;s API credentials?<br>  automount: true<br>  # Annotations to add to the service account<br>  annotations: {}<br>  # The name of the service account to use.<br>  # If not set and create is true, a name is generated using the fullname template<br>  name: &quot;&quot;<br><br>podAnnotations: {}<br>podLabels: {}<br><br>podSecurityContext: {}<br>  # fsGroup: 2000<br><br>securityContext: {}<br>  # capabilities:<br>  #   drop:<br>  #   - ALL<br>  # readOnlyRootFilesystem: true<br>  # runAsNonRoot: true<br>  # runAsUser: 1000<br><br>service:<br>  type: ClusterIP<br>  port: 9996<br>  targetPort: 9996<br><br>ingress:<br>  enabled: true<br>  className: &quot;nginx&quot;<br>  annotations: {}<br>    # kubernetes.io/ingress.class: nginx<br>    # kubernetes.io/tls-acme: &quot;true&quot;<br>  hosts:<br>    - host: batfish.network.local<br>      paths:<br>        - path: /<br>          pathType: Prefix<br>          backend:<br>            service:<br>              name: batfish<br>              port:<br>                number: 9996<br>  tls: []<br>  #  - secretName: chart-example-tls<br>  #    hosts:<br>  #      - chart-example.local<br><br>resources: {}<br>  # We usually recommend not to specify default resources and to leave this as a conscious<br>  # choice for the user. This also increases chances charts run on environments with little<br>  # resources, such as Minikube. If you do want to specify resources, uncomment the following<br>  # lines, adjust them as necessary, and remove the curly braces after &#39;resources:&#39;.<br>  # limits:<br>  #   cpu: 100m<br>  #   memory: 128Mi<br>  # requests:<br>  #   cpu: 100m<br>  #   memory: 128Mi<br><br>#livenessProbe:<br>#  httpGet:<br>#    path: /<br>#    port: http<br>#readinessProbe:<br>#  httpGet:<br>#    path: /<br>#    port: http<br><br>autoscaling:<br>  enabled: false<br>  minReplicas: 1<br>  maxReplicas: 100<br>  targetCPUUtilizationPercentage: 80<br>  # targetMemoryUtilizationPercentage: 80<br><br># Additional volumes on the output Deployment definition.<br>volumes: []<br># - name: foo<br>#   secret:<br>#     secretName: mysecret<br>#     optional: false<br><br># Additional volumeMounts on the output Deployment definition.<br>volumeMounts: []<br># - name: foo<br>#   mountPath: &quot;/etc/foo&quot;<br>#   readOnly: true<br><br>nodeSelector: {}<br><br>tolerations: []<br><br>affinity: {}</pre><p><em>Explanation</em><strong><em>:</em></strong></p><p>• <em>replicaCount</em>: Defines the number of Batfish pods to deploy (1 in this case).</p><p>• <em>image</em>: Specifies the container image for Batfish, the pull policy (IfNotPresent ensures the image is pulled only if not cached), and the image tag.</p><p>• <em>service</em>: Exposes the Batfish service using the ClusterIP type, which makes the application accessible on a specified port (9996).</p><p>• <em>ingress</em>: Enables an NGINX ingress resource to expose the application via a domain name (batfish.network.local).</p><h4><strong>Kubernetes Templates</strong></h4><p><strong>Deployment Template</strong></p><p>The templates/deployment.yaml file defines the Batfish pod and its configurations:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: {{ .Release.Name }}<br>spec:<br>  replicas: {{ .Values.replicaCount }}<br>  selector:<br>    matchLabels:<br>      app: {{ .Chart.Name }}<br>  template:<br>    metadata:<br>      labels:<br>        app: {{ .Chart.Name }}<br>    spec:<br>      containers:<br>        - name: batfish<br>          image: &quot;{{ .Values.image.repository }}:{{ .Values.image.tag }}&quot;<br>          ports:<br>            - containerPort: {{ .Values.service.targetPort }}</pre><p><em>Explanation</em><strong><em>:</em></strong></p><p><em>• replicas:</em> Specifies the number of pod replicas to run (configurable through values.yaml).</p><p>• <em>matchLabels:</em> Ensures the Deployment selects pods with matching labels.</p><p><em>• containers:</em> Specifies the Batfish container image and the port it listens on.</p><p><strong>Service Template</strong></p><p>The templates/service.yaml file exposes the Batfish application:</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: {{ .Release.Name }}<br>spec:<br>  type: {{ .Values.service.type }}<br>  ports:<br>    - port: {{ .Values.service.port }}<br>      targetPort: {{ .Values.service.targetPort }}<br>  selector:<br>    app: {{ .Chart.Name }}</pre><p><em>Explanation:</em></p><p><em>• ports: </em>Maps external traffic to the container’s port.</p><p><em>. selector:</em> Links the service to the corresponding Batfish pods based on labels.</p><h3><strong>Step 2: Deploy Batfish with Helm</strong></h3><p>1. <strong>Set up kubeconfig</strong>:</p><p>Export your kubeconfig file to authenticate with your Kubernetes cluster:</p><pre>export KUBECONFIG=/path/to/kubeconfig</pre><p>2. <strong>Deploy the Helm chart</strong>:</p><p>Use the following command to install or upgrade the Batfish deployment manually:</p><pre>helm upgrade --install batfish ./charts --namespace batfish --create-namespace</pre><p>. Upgrade — install: Ensures the chart is installed or updated.</p><p>. — namespace: Specifies the namespace for the deployment.</p><p>3. <strong>Verify the deployment</strong>:</p><p>Check the status of the pods and services:</p><pre>kubectl get pods -n batfish<br>kubectl get svc -n batfish</pre><h3><strong>Step 3: Automate Deployment with CI/CD</strong></h3><p>A CI/CD pipeline automates deployments, ensuring repeatability and consistency. Below is an example .gitlab-ci.yml file for GitLab CI/CD:</p><pre>stages:<br>  - deploy<br><br>variables:<br>  APP_NAME: batfish<br>  KUBECONFIG: $KUBECONFIG_B64<br><br>deploy:<br>  stage: deploy<br>  image:<br>    name: alpine/helm:3.2.1<br>    entrypoint: [&quot;&quot;]<br>  script:<br>    - mkdir -p ~/.kube<br>    - echo &quot;$KUBECONFIG&quot; | base64 -d &gt; ~/.kube/config<br>    - export KUBECONFIG=~/.kube/config<br>    - helm upgrade --install ${APP_NAME} ./charts --values=./charts/values.yaml --namespace ${APP_NAME} --create-namespace<br>  rules:<br>    - if: $CI_COMMIT_BRANCH == &#39;main&#39;<br>      when: always</pre><p><em>Explanation:</em></p><p><em>• stages:</em> Defines the stages in the pipeline (e.g., deploy).</p><p><em>• variables:</em> Includes the application name and kubeconfig file (base64-encoded).</p><p><em>. script:</em> Automates the deployment process, decoding the kubeconfig, setting the environment variable, and running the Helm command.</p><h3><strong>Step 4: Interact with Batfish Using Python</strong></h3><p>After deployment, you can interact with the Batfish server using the pybatfish library:</p><pre>from pybatfish.client.session import Session<br><br># Connect to Batfish<br>bf = Session(host=&quot;1.2.3.4&quot;, port_v2=&quot;80&quot;)<br><br># Initialize snapshot<br>snapshot_path = &quot;/path/to/snapshots/cfg_files&quot;<br>bf.init_snapshot(snapshot_path, overwrite=True)<br><br>print(f&quot;Connected to Batfish at {bf.host}:{bf.port_v2}&quot;)</pre><p><em>Explanation:</em></p><p><em>• Session:</em> Establishes a connection to the Batfish server.</p><p><em>• host:</em> Specifies the IP address or domain of the Batfish service.</p><p><em>. init_snapshot: </em>Uploads a snapshot of network configurations for analysis.</p><p>. Service_port “9996” will change to “80” in NGINX-Ingress Controller Configuration.</p><h4><strong>Conclusion</strong></h4><p>With Kubernetes, Helm, and CI/CD, deploying Batfish becomes efficient and scalable. We have:</p><p>1. <strong>Simplified deployment</strong> with Helm charts.</p><p>2. <strong>Ensured high availability</strong> and scalability with Kubernetes.</p><p>3. <strong>Automated workflows</strong> using a CI/CD pipeline.</p><p>4. <strong>Integrated Batfish into workflows</strong> using the Python API.</p><p>This approach not only improves reliability but also minimizes manual effort. Let us know if you have questions or suggestions to enhance this process!</p><p><em>Happy Kubernetes-ing!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5236da996956" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>