<?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 Muneer Mansoori on Medium]]></title>
        <description><![CDATA[Stories by Muneer Mansoori on Medium]]></description>
        <link>https://medium.com/@muneer0692?source=rss-39fe737ecebf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Usdhy1psy09MeI_-CQAQmg.jpeg</url>
            <title>Stories by Muneer Mansoori on Medium</title>
            <link>https://medium.com/@muneer0692?source=rss-39fe737ecebf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 02:16:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muneer0692/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Mastering Kubernetes Scheduling: Node Selector, Node Affinity, and Taints & Tolerations Explained]]></title>
            <link>https://medium.com/@muneer0692/mastering-kubernetes-scheduling-node-selector-node-affinity-and-taints-tolerations-explained-957022c5cdc6?source=rss-39fe737ecebf------2</link>
            <guid isPermaLink="false">https://medium.com/p/957022c5cdc6</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[containerization]]></category>
            <dc:creator><![CDATA[Muneer Mansoori]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 15:33:21 GMT</pubDate>
            <atom:updated>2026-02-06T15:33:21.565Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*wxyWAxGRoWewQumO.png" /></figure><p>When you deploy applications on Kubernetes or Google Kubernetes Engine (GKE), one of the most crucial yet often overlooked aspects is <strong>how your Pods get scheduled across nodes</strong>. Efficient scheduling isn’t just about getting a Pod running — it’s about <strong>placing workloads intelligently</strong> to optimize performance, reliability, and cost.</p><p>In this blog, we’ll explore three powerful scheduling tools in Kubernetes — <strong>Node Selector</strong>, <strong>Node Affinity</strong>, and <strong>Taints &amp; Tolerations</strong> — and how to use them effectively in real-world scenarios.</p><h3>1. Node Selector: The Simplest Placement Strategy</h3><p>The <strong>Node Selector</strong> is Kubernetes’ most basic method to restrict where Pods can run. It matches Pod requirements to node labels directly — no conditions, no flexibility, just a straightforward key-value match.</p><p>For example, if you label certain nodes as node-01:</p><pre>#kubectl label nodes &lt;NODE_NAME&gt; &lt;KEY&gt;=&lt;VALUE&gt;</pre><pre>kubectl label nodes gke-cluster-lk-node-01-e43418b8-p8mm node-type=node-01</pre><p>You can use a nodeSelector in your Pod specification:</p><pre>spec:<br>  nodeSelector:<br>    node-type: node-01</pre><p>Then, what Deployment.yaml looks like:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: nginx-deployment<br>  labels:<br>    app: nginx<br>spec:<br>  replicas: 3  # Number of nginx pods<br>  selector:<br>    matchLabels:<br>      app: nginx<br>  template:<br>    metadata:<br>      labels:<br>        app: nginx<br>    spec:<br>      nodeSelector:<br>        node-type: node-01<br>      containers:<br>      - name: nginx<br>        image: nginx:latest<br>        ports:<br>        - containerPort: 80</pre><p>Let’s apply deployment.yaml file</p><pre>kubectl apply -f deployment.yaml</pre><p>You can check pod is scheduled at node: node-01</p><pre>kubectl get pod -o wide</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*Xsfzh6Zffs1VcNH3.png" /></figure><p>This tells Kubernetes to schedule the Pod <strong>only on nodes labeled <em>node-type=node-01</em></strong></p><p><strong>When to Use:</strong></p><ul><li>You want simple, static placement rules.</li><li>Your cluster nodes have clear, well-defined purposes.</li></ul><p><strong>Limitations:</strong></p><ul><li>No logical operators (In, NotIn, etc.).</li><li>No preference or “best effort” scheduling — either a node matches or the Pod stays pending.</li></ul><h3>2. Node Affinity: Smarter and More Expressive Scheduling</h3><p><strong>Node Affinity</strong> builds upon Node Selector with a richer syntax, more flexibility, and support for both <strong>hard</strong> and <strong>soft</strong> rules. It allows Kubernetes to make smarter scheduling decisions while giving you control over constraints and preferences.</p><p>There are two main types of Node Affinity:</p><p><strong>a. Required Node Affinity (Hard Constraints)</strong></p><p>Pods <strong>must</strong> run only on nodes that meet these rules. If no nodes match, the Pod will remain <strong>Pending</strong> until a suitable node appears.</p><pre>affinity:<br>  nodeAffinity:<br>    requiredDuringSchedulingIgnoredDuringExecution:<br>      nodeSelectorTerms:<br>      - matchExpressions:<br>        - key: node-type<br>          operator: In<br>          values:<br>          - node-01</pre><p>Then deployment.yaml file looks like-</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: nginx-deployment<br>  labels:<br>    app: nginx<br>spec:<br>  replicas: 3  # Number of nginx pods<br>  selector:<br>    matchLabels:<br>      app: nginx<br>  template:<br>    metadata:<br>      labels:<br>        app: nginx<br>    spec:<br>        affinity:<br>          nodeAffinity:<br>              requiredDuringSchedulingIgnoredDuringExecution:<br>                nodeSelectorTerms:<br>                - matchExpressions:<br>                  - key: node-type<br>                    operator: In<br>                    values:<br>                    - node-01<br>        containers:<br>        - name: nginx<br>          image: nginx:latest<br>          ports:<br>          - containerPort: 80</pre><p>This ensures Pods are scheduled <strong>only on node-01 nodes</strong>.</p><p>Once you applied the changes, you can verify that pods are getting scheduled only on node-01</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*4Rt9GsQusc5cYFW1.png" /></figure><p><strong>Things to Remember:</strong></p><ul><li>If you use the <strong>wrong key or value</strong> in matchExpressionsYour Pod will stay <strong>Pending</strong> (no matching node found).</li><li>You can define <strong>multiple values</strong> under values: — The Pod can be scheduled on <strong>any node</strong> that matches <strong>one of them</strong>.</li></ul><h3>b. Preferred Node Affinity (Soft Constraints)</h3><p>Preferred rules express <strong>preferences</strong> — Kubernetes will try to honor them, but the Pod can still run elsewhere if no matching node is available.</p><pre>affinity:<br>  nodeAffinity:<br>    preferredDuringSchedulingIgnoredDuringExecution:<br>    - weight: 1<br>      preference:<br>        matchExpressions:<br>        - key: node-type<br>          operator: In<br>          values:<br>          - node-04</pre><p>Once you applied the changes, you can verify if node (node-04) is not available, then k8s will schedule this pod on any available nodes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*1Yww_vwSD06YuMMG.png" /></figure><p>This gives you the best of both worlds: <strong>optimized placement without hard failures</strong>.</p><h3>Why Combine Both?</h3><p>Using both <strong>required</strong> and <strong>preferred</strong> affinity rules helps you balance <strong>must-have conditions</strong> with <strong>nice-to-have preferences</strong>.</p><ul><li><strong>Required rules</strong> ensure Pods are scheduled <em>only</em> on nodes meeting critical needs (like specific CPU, memory, or storage type).</li><li><strong>Preferred rules</strong> guide the scheduler toward <em>better</em> options — such as certain zones or high-performance nodes — without blocking scheduling if they’re unavailable.</li></ul><p>Common Node Affinity Operators</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*PCT79qtxDMliZUCX.png" /></figure><h3>3. Taints and Tolerations:</h3><p>While Node Affinity attracts Pods to nodes, <strong>taints</strong> do the opposite — they <strong>repel Pods</strong> unless those Pods explicitly tolerate the taint. The key options for taints and their effects are:</p><ul><li><strong>NoSchedule:</strong> Blocks Pods without a matching toleration — used to reserve nodes for specific workloads.</li><li><strong>PreferNoSchedule:</strong> Tries to avoid placing unmatched Pods, but not guaranteed — a soft preference.</li><li><strong>NoExecute:</strong> Evicts existing unmatched Pods and blocks new ones — useful for node maintenance.</li></ul><p>Taints are applied at the node level, for example:</p><pre># kubectl taint nodes &lt;NODE_NAME&gt; &lt;KEY&gt;=&lt;VALUE&gt;:options</pre><pre>kubectl taint nodes gke-cluster-lk-node-02-bbbf2710-npbh  dedicated=database:NoSchedule</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*vjYI9vBieeaWSvCq.png" /></figure><p>This marks the node as “dedicated for highmem/database workloads.” Unless a Pod has a matching toleration, it won’t be scheduled there.</p><p>To allow a Pod to run on that node:</p><pre>tolerations:<br>- key: &quot;dedicated&quot;<br>  operator: &quot;Equal&quot;<br>  value: &quot;highmem&quot;<br>  effect: &quot;NoSchedule&quot;</pre><p>This Pod now <strong>tolerates</strong> the taint and can be placed on that node.</p><p><strong>When to Use Taints and Tolerations</strong></p><ul><li>To <strong>reserve GPU or highmem</strong>/<strong>database nodes</strong> for specific workloads.</li><li>To <strong>isolate critical Pods</strong> from less important ones.</li><li>To <strong>avoid noisy neighbors</strong> by repelling generic workloads.</li></ul><p>Think of it like a “VIP area” — only Pods with the right badge (toleration) get in.</p><h3>Assigning Applications to Exclusive Nodes with Affinity and Taints-</h3><p><strong>Scenario</strong></p><p>You have three nodes: default, node-01, and node-02.<br>Goal:</p><ol><li>Ensure your workload runs <strong>only</strong> on node-01 or node-02 (never on default).</li><li>Make node-02 reserved so it accepts <strong>only</strong> your workload and not other pods.</li></ol><p>We’ll achieve this with node labels, a taint on node-02, and a pod nodeAffinity + toleration.</p><pre># kubectl label nodes &lt;NODE_01_NAME&gt; &lt;KEY&gt;=&lt;VALUE&gt;<br>kubectl label nodes gke-cluster-lk-node-01-e43418b8-p8mm node-type=node-01</pre><pre># kubectl label nodes &lt;NODE_01_NAME&gt; &lt;KEY&gt;=&lt;VALUE&gt;<br>kubectl label nodes gke-cluster-lk-node-02-bbbf2710-npbh node-type=node-02</pre><pre># kubectl taint nodes &lt;NODE_NAME&gt; &lt;KEY&gt;=&lt;VALUE&gt;:options<br>kubectl taint nodes gke-cluster-lk-node-01-e43418b8-p8mm dedicated=highmem:NoSchedule</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*sVbU2R0MStjIKqwv.png" /></figure><p>Now, create a Pod that both selects these nodes <strong>and tolerates</strong> the taint:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: my-nginx-deployment<br>  labels:<br>    app: nginx<br>spec:<br>  replicas: 10 # Number of nginx pods<br>  selector:<br>    matchLabels:<br>      app: nginx<br>  template:<br>    metadata:<br>      labels:<br>        app: nginx<br>    spec:<br>      affinity:<br>        nodeAffinity:<br>          requiredDuringSchedulingIgnoredDuringExecution:<br>            nodeSelectorTerms:<br>            - matchExpressions:<br>              - key: node-type<br>                operator: In<br>                values:<br>                - node-01<br>                - node-02<br>      tolerations:<br>      - key: &quot;dedicated&quot;<br>        operator: &quot;Equal&quot;<br>        value: &quot;highmem&quot;<br>        effect: &quot;NoSchedule&quot;<br>      containers:<br>      - name: nginx<br>        image: nginx:latest<br>        ports:<br>        - containerPort: 80</pre><p>Once you apply the above manifest, your workload will be scheduled <strong>only on </strong><strong>node-01 or </strong><strong>node-02</strong>, and <strong>never on the default node</strong> — even if resources on those nodes are fully utilized or unavailable. You can see this behavior illustrated in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*KYHvwx4x2j2QYw8N.png" /></figure><p>This setup ensures that <strong>only analytics Pods</strong> with the defined toleration and affinity can run on high-memory nodes, keeping your resources <strong>well-isolated</strong> and workloads <strong>consistent and predictable</strong>.</p><p>Thank you for reading — I hope this guide helped simplify Node Selector, Node Affinity, and Taints &amp; Tolerations for your Kubernetes journey.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=957022c5cdc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Scalable End-to-End CI/CD Pipeline with Tekton, GitHub, and Kubernetes]]></title>
            <link>https://medium.com/@muneer0692/building-a-scalable-end-to-end-ci-cd-pipeline-with-tekton-github-and-kubernetes-84aa358a3089?source=rss-39fe737ecebf------2</link>
            <guid isPermaLink="false">https://medium.com/p/84aa358a3089</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[github-integration]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[tekton-pipeline]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Muneer Mansoori]]></dc:creator>
            <pubDate>Mon, 18 Aug 2025 16:08:57 GMT</pubDate>
            <atom:updated>2025-08-18T16:08:57.137Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QEYfFfQubMjy8KfXmGBJag.png" /><figcaption>graphical view of this workflow</figcaption></figure><p><em>In this article, Let’s see how to create end-to-end pipeline using tekton. Whenever new code push to github repo, automically trigger build code and deploy on kubernetes</em></p><p><strong>Tekton</strong> is a framework for building and running CI/CD pipelines on Kubernetes. It helps automate the process of building, testing, and deploying applications in a scalable and portable way..</p><h4>Key components of Tekton include:</h4><p>1.<strong> Task</strong>: An atomic unit of work in a pipeline. A task represents a specific action or operation to be performed, such as building a Docker image or running tests.</p><p>2. <strong>TaskRun</strong>: An instance of a task execution within a pipeline run. It represents the execution of a specific task with its input parameters and resources.</p><p>3. <strong>Pipeline</strong>: A set of steps that define the CI/CD workflow. Pipelines are composed of tasks, which are the building blocks of work in Tekton.</p><p>4. <strong>PipelineRun</strong>: An instance of a pipeline execution. It represents the execution of a pipeline with specific input parameters and resources.</p><p><strong>5. EventListener: </strong>It<strong> </strong>listens to the world waiting for “something” to happen.</p><p>6. <strong>TriggerTemplate:</strong> It configures a PipelineRun when this event occurs.</p><p>7. <strong>TriggerBinding</strong>: It passes the data to the <em>PipelineRun</em> created by the <em>TriggerTemplate.</em></p><p><strong>8. Trigger</strong>: Decides what to do with the received event. Sets a <em>TriggerBinding</em>, <em>TriggerTemplate</em> and <em>Interceptor</em> to run.</p><p><strong>9. Interceptor</strong>: Processes an event to do custom validation or filtering</p><p><strong>Prerequisites</strong></p><ul><li>GCP project</li><li>GKE Cluster</li></ul><p>I assume you already have a GKE cluster if you don’t, you can create one using the below command</p><pre>gcloud container clusters create my-cluster \<br>    --zone us-central1-c \<br>    --node-locations us-central1-c</pre><p><strong>Connect to the GKE Cluster</strong></p><pre>gcloud container clusters get-credentials my-cluster \<br>--zone us-central1-c --project &lt;project_id&gt;</pre><p>Install kubectl. If you don’t have kubectl command</p><pre>sudo apt-get install kubectl<br>sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin</pre><p>Install some of the dependencies like namespace, service account and permissions etc.</p><pre>curl -LO https://github.com/tektoncd/cli/releases/download/v0.30.1/tektoncd-cli-0.30.1_Linux-64bit.deb<br>sudo dpkg -i ./tektoncd-cli-0.30.1_Linux-64bit.deb<br><br>kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml<br>kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml<br>kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/latest/interceptors.yaml</pre><pre>#check all pods should running<br>kubectl get pods --namespace tekton-pipelines --watch</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6n9voq80CHGv0R4ROsyG-w.png" /><figcaption>All pods are running</figcaption></figure><p><strong>Installing Tekton Dashboard with the installer script</strong>:</p><pre>curl -sL https://raw.githubusercontent.com/tektoncd/dashboard/main/scripts/release-installer | \<br>   bash -s -- install latest --read-write</pre><p>After executing It will create deployment and svc with same nametekton-dashboard in namespace tekton-pipelines .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3mgbyupqwdtoaqclVfS8Hw.png" /></figure><p>It’s using ClusterIP service type. It can’t be accessible from outside, use kubectl edit svc/tekton-dashboard --namespace tekton-pipelines command and change type: ClusterIP to type: LoadBalancer then save &amp; execute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ipeCH5SyiWG51wiWVNpkrA.png" /></figure><pre>kubectl get svc/tekton-dashboard --namespace tekton-pipelines</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cBUqsdSpz46IvlI6GPLjPQ.png" /><figcaption>Now publicIP come</figcaption></figure><p><strong>See the tekton dashboard</strong></p><pre>#http://&lt;copy_External-ip&gt;:9097/<br>#in my case<br>http://35.184.50.80:9097/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HAZdYsGEQDA5bgUoNBviNA.png" /></figure><p><strong>Task:</strong> It runs in individual pod and this task will clone git repo, build and deploy new release on k8s.</p><pre>apiVersion: tekton.dev/v1beta1<br>kind: Task<br>metadata:<br>  name: build-and-push<br>spec:<br>  params:<br>    - name: repo-url<br>      type: string<br>    - name: image-name<br>      type: string<br>    - name: image-tag<br>      type: string<br>      default: latest<br>  steps:<br>#This step will clone git repo and store &#39;/workspace/source&#39; and further we&#39;ll share this dir to other steps <br>    - name: git-clone<br>      image: alpine/git<br>      workingDir: /workspace/source<br>      command:<br>        - sh<br>      args:<br>        - -c<br>        - |<br>          git clone $(params.repo-url) <br>#This step will use shared dir(&#39;/workspace/source&#39;), build image and push it dockerhub <br>    - name: build-and-push<br>      image: docker<br>      <br>      env:<br>      # Connect to the sidecar over TCP, with TLS.<br>      - name: DOCKER_HOST<br>        value: tcp://localhost:2376<br>      # Verify TLS.<br>      - name: DOCKER_TLS_VERIFY<br>        value: &#39;1&#39;<br>      # Use the certs generated by the sidecar daemon.<br>      - name: DOCKER_CERT_PATH<br>        value: /certs/client<br>      workingDir: /workspace/source<br>      script: |<br>          #!/usr/bin/env sh<br>          set -e<br>          cd simple-dockerfile<br>          docker build -t my-image-1 .<br>          docker tag my-image-1 muneer16/testing-repo<br>          #give the username &amp; password for dockerhub authentication<br>          docker login -u &lt;userName&gt; -p &lt;passwd&gt;<br>          #specifying dockerhub repo where I want to push image<br>          docker push muneer16/testing-repo<br>         <br><br>      volumeMounts:<br>      - mountPath: /certs/client<br>        name: dind-certs<br># This step will deploy pod with latest image<br>    - name: deployment<br>      image: lachlanevenson/k8s-kubectl<br>      workingDir: /workspace/source<br>      command: [&quot;kubectl&quot;]<br>      args:<br>        - &quot;apply&quot;<br>        - &quot;-f&quot;<br>        - &quot;./simple-dockerfile/deploy.yaml&quot;<br># Here we are rolling out deployment so that pod can lunch with latest image<br>    - name: run-kubectl-rollout<br>      image: lachlanevenson/k8s-kubectl<br>      workingDir: /workspace/source<br>      command: [&quot;kubectl&quot;]<br>      args:<br>        - &quot;rollout&quot;<br>        - &quot;restart&quot;<br>        - &quot;deploy/my-web-app&quot;<br>        <br>  sidecars:<br>  - image: docker:dind<br>    name: server<br>    args:<br>      - --storage-driver=vfs<br>      - --userland-proxy=false<br>      - --debug<br>  #    computeResources:<br>  #      requests:<br>  #        memory: &quot;512Mi&quot;<br>    securityContext:<br>      privileged: true<br>    env:<br>    # Write generated certs to the path shared with the client.<br>    - name: DOCKER_TLS_CERTDIR<br>      value: /certs<br>    volumeMounts:<br>    - mountPath: /certs/client<br>      name: dind-certs<br>     # Wait for the dind daemon to generate the certs it will share with the<br>      # client.<br>    readinessProbe:<br>     periodSeconds: 1<br>     exec:<br>        command: [&#39;ls&#39;, &#39;/certs/client/ca.pem&#39;]<br>  volumes:<br>  - name: dind-certs<br>    emptyDir: {}</pre><p><strong>Changes:</strong></p><ul><li><strong>&lt;userName&gt;</strong> dockerhub user name.</li><li><strong>&lt;passwd&gt;</strong> dockerhub password.</li><li><strong>./simple-dockerfile/deploy.yaml</strong> — Path of deployment file if you are cloning defferent github repo then give path of your deploy.yaml file.</li></ul><p><strong>spec</strong>: This section contains the specifications for the Task.</p><p><strong>params</strong>: Here, you define the input parameters for the Task. In this case, it expects three string parameters: repo-url, image-name, and image-tag. The image-tag parameter has a default value of &quot;latest&quot;.</p><p><strong>steps</strong>: This section lists the individual steps to be executed in the Task. Every step runs in individual container when step done container and it’s all data will be deleted . By using <strong>workingDir</strong> we can store step permanently and also can share with steps.</p><ul><li><em>git-clone</em> This step clones a Git repository specified by the repo-url parameter using the alpine/git image and store on <em>/workspace/source</em> location which will be shared with other steps.</li><li><em>build-and-push</em> This step builds a Docker image, tags it, performs a Docker login and pushes the image to a repository. It uses the docker image.</li><li><em>deployment</em> This step uses the kubectl command from the lachlanevenson/k8s-kubectl image to apply a Kubernetes deployment configuration specified in the deploy.yaml file.</li></ul><p>sidecars: This section defines a sidecar container that runs alongside the main Task steps. This sidecar uses the docker:dind image to provide a Docker-in-Docker environment. It has privileged access, mounts volumes, and sets up environment variables for Docker TLS.</p><p><strong>Pipeline:</strong></p><pre>apiVersion: tekton.dev/v1beta1<br>kind: Pipeline<br>metadata:<br>  name: first-pipeline<br>spec:<br>  params:<br>    - name: repo-url<br>      type: string<br>    - name: image-name<br>      type: string<br>    - name: image-tag<br>      type: string<br>      default: latest<br><br>  tasks:<br>    - name: hello<br>      taskRef:<br>        name: build-and-push<br> <br>      params:<br>      - name: repo-url<br>        value: $(params.repo-url)<br>      - name: image-name<br>        value: $(params.image-name)<br>      - name: image-tag<br>        value: $(params.image-tag</pre><p>tasks: This section lists the tasks to be executed in the Pipeline.</p><ul><li>name: hello: This is the name of the task within the Pipeline.</li><li>taskRef: name: build-and-push: This specifies that the task to be executed is named &quot;build-and-push&quot;. The actual definition of this task is defined elsewhere.</li></ul><p><strong>TriggerTemplate:</strong></p><pre>apiVersion: triggers.tekton.dev/v1beta1<br>kind: TriggerTemplate<br>metadata:<br>  name: pipeline-template<br>spec:<br>  <br>  params:<br>    - name: repo-url<br>      #here we are defining github repo which we are going to clone<br>      default: https://github.com/muneermansoori-cloudside/simple-dockerfile.git<br>    - name: image-name<br>      #defining image name with proper naming convention<br>      default: muneer16/testing-repo<br>    - name: image-tag<br>      #defining tag <br>      default: latest<br>  resourcetemplates:<br>  - apiVersion: tekton.dev/v1beta1<br>    kind: PipelineRun<br>    metadata:<br>      generateName: hello-goodbye-run-<br>    spec:<br>      serviceAccountName: pipeline-account<br>      pipelineRef:<br>        name: first-pipeline<br>      params:<br>      - name: repo-url<br>        value: $(tt.params.repo-url)<br>      - name: image-name<br>        value: $(tt.params.image-name)<br>      - name: image-tag<br>        value: $(tt.params.image-tag)<br><br></pre><p>resourcetemplates Here we’ll define our pipeline runner.</p><p>generateName: This defines a generated name for the PipelineRun resources created from this TriggerTemplate.</p><p>serviceAccountName This specifies the service account to be used for running the PipelineRun.</p><p><em>NOTE: before executing above file first create service account with this name </em>pipeline-account</p><p><strong>ServiceAccount: </strong>pipeline-account</p><pre>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: pipeline-account<br><br>---<br><br>kind: Role<br>apiVersion: rbac.authorization.k8s.io/v1<br>metadata:<br>  name: pipeline-role<br>rules:<br>- apiGroups: [&quot;&quot;]<br>  resources: [&quot;services&quot;]<br>  verbs: [&quot;get&quot;, &quot;create&quot;, &quot;update&quot;, &quot;patch&quot;]<br>- apiGroups: [&quot;apps&quot;]<br>  resources: [&quot;deployments&quot;]<br>  verbs: [&quot;get&quot;, &quot;create&quot;, &quot;update&quot;, &quot;patch&quot;]<br><br>---<br><br>apiVersion: rbac.authorization.k8s.io/v1<br>kind: RoleBinding<br>metadata:<br>  name: pipeline-role-binding<br>roleRef:<br>  apiGroup: rbac.authorization.k8s.io<br>  kind: Role<br>  name: pipeline-role<br>subjects:<br>- kind: ServiceAccount<br>  name: pipeline-account</pre><p><strong>TriggerBinding</strong>:</p><pre>apiVersion: triggers.tekton.dev/v1beta1<br>kind: TriggerBinding<br>metadata:<br>  name: pipeline-binding<br>spec: <br>  params:<br>  - name: repo-url<br>    value: $(tt.params.repo-url)<br>  - name: image-name<br>    value: $(tt.params.image-name)<br>  - name: image-tag<br>    value: $(tt.params.image-tag)</pre><p><strong>ServiceAccount: </strong>tekton-robot for eventListener</p><pre>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: tekton-robot<br>secrets:<br>  - name: pipeline-secret<br>  <br>---<br>apiVersion: rbac.authorization.k8s.io/v1<br>kind: RoleBinding<br>metadata:<br>  name: triggers-example-eventlistener-binding<br>subjects:<br>- kind: ServiceAccount<br>  name: tekton-robot<br>roleRef:<br>  apiGroup: rbac.authorization.k8s.io<br>  kind: ClusterRole<br>  name: tekton-triggers-eventlistener-roles<br>---<br>apiVersion: rbac.authorization.k8s.io/v1<br>kind: ClusterRoleBinding<br>metadata:<br>  name: triggers-example-eventlistener-clusterbinding<br>subjects:<br>- kind: ServiceAccount<br>  name: tekton-robot<br>  namespace: default<br>roleRef:<br>  apiGroup: rbac.authorization.k8s.io<br>  kind: ClusterRole<br>  name: tekton-triggers-eventlistener-clusterroles</pre><p><strong>Secret</strong>: for github webhooks</p><pre>apiVersion: v1<br>kind: Secret<br>metadata:<br>  name: pipeline-secret<br>type: Opaque<br>stringData:<br>  secretToken: &quot;1234567&quot;</pre><p>Notedown value “1234567” It will be use while creating webhook on github side</p><p><strong>EventListener:</strong></p><pre>apiVersion: triggers.tekton.dev/v1alpha1<br>kind: EventListener<br>metadata:<br>  name: eventlistener<br>spec:<br>  serviceAccountName: tekton-robot<br>  triggers:<br>  - name: github-listener<br>    interceptors:<br>    - github:<br>        secretRef:<br>          secretName: pipeline-secret<br>          secretKey: secretToken<br>        eventTypes:<br>        - push<br>    - cel:<br>        filter: &quot;body.ref == &#39;refs/heads/master&#39;&quot;<br>    bindings:<br>    - ref: pipeline-binding<br>    template:<br>      ref: pipeline-template</pre><p>spec: This section contains the specifications for the EventListener.</p><p>serviceAccountName: This specifies the service account(tekton-robot) to be used for running the EventListener.</p><p>github: This interceptor handles events from GitHub repositories. It references a secret named &quot;pipeline-secret&quot; and uses the &quot;secretToken&quot; key to authenticate the GitHub event. It specifies the eventType as &quot;push&quot;, indicating that the trigger should fire when a push event occurs.</p><p>bindings: This section specifies the bindings to be applied to the trigger.</p><p>template: This section specifies the template to be used for the trigger.</p><p>when you’ll create eventlistener. This will automatically create service(ClusterIP). service name would be el-&lt;eventListenerName&gt; in our case el-eventlistener. which will listen event locally. But If you want to get event from github then you have to expose it outside.</p><pre>kubectl get svc/el-eventlistener</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*HPNGMwd9vIhVvijqeYQg2g.png" /></figure><p>We are using ingress to expose el-eventlistener svc to outside</p><p><strong>Ingress</strong>:</p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: ingress-resource<br>spec:<br>  rules:<br>    - http:<br>        paths:<br>          - path: /hooks<br>            pathType: Exact<br>            backend:<br>              service:<br>                name: el-eventlistener<br>                port:<br>                  number: 8080</pre><p>specify backend service name el-eventlistener.</p><p>It will take few minutes to create. When It will create, It returns a publicIP. Note this publicIP. I will be use while creating webhook on github side</p><p>Let’s Create Webhook on github side.</p><p>Go to github repo which you are cloning and click on settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*akEsvANHgiLGEvhYP_YpGw.png" /></figure><p>First click on Webhooks and then click Add Webhook</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E_llFspfD6yKpGXIV4yzQA.png" /></figure><p>Click Add webhook to create</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*dzu1vDYz7xZrRyhJxiWRig.png" /></figure><p><strong>Content type</strong> → Applicaton/Json</p><p>Let’s check working of end-to-end pipeline</p><ul><li>clone git repo to local system</li></ul><pre>git clone https://github.com/muneermansoori-cloudside/simple-dockerfile.git<br>cd simple-dockerfile<br>date &gt; temp.txt<br>git add .<br>git commit -m &quot;something change&quot;</pre><ul><li>Run git push command to apply the changes in github master repo</li></ul><pre>#to run this command you have to provide github username and token<br>git push -u origin master</pre><p>As soon as some changes push to this repo webhook send notification to event trigger, event trigger execute pipeline-runs and finally pipelline-run execute the pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*ODcYO_5DYhTd63vlc8dOkA.png" /></figure><p>Here you can see all the steps of the task have been successfully executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAD-r982SNZgGvpRt9on_Q.png" /></figure><p>You can check pipeline-run logs using cli also</p><pre>tkn pipelinerun logs &lt;pipeline-runner-name&gt;-f</pre><pre>#check the deployment is running with latest image (which we have buil)<br>kubectl get deploy/my-web-app</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*_koOM0tDYdqYqY8KMzSJ0A.png" /><figcaption>Application is deployed with latest code</figcaption></figure><p>We hope that this guide has been informative and helpful in your journey towards creating an end-to-end pipeline. If you have any questions or comments, please feel free to leave them below. Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84aa358a3089" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step-by-Step Setup and Speed Test: Private GCS with Signed URLs, Cloud CDN, and Custom SSL]]></title>
            <link>https://medium.com/@muneer0692/step-by-step-setup-and-speed-test-private-gcs-with-signed-urls-cloud-cdn-and-custom-ssl-084431d3ecd7?source=rss-39fe737ecebf------2</link>
            <guid isPermaLink="false">https://medium.com/p/084431d3ecd7</guid>
            <dc:creator><![CDATA[Muneer Mansoori]]></dc:creator>
            <pubDate>Wed, 13 Aug 2025 13:39:29 GMT</pubDate>
            <atom:updated>2025-08-13T13:39:29.700Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*Pzuu-ERIelIJNgsBF25ZWg.png" /></figure><p>This guide will walk you through the process of securely accessing private Google Cloud Storage (GCS) buckets using signed URLs and Cloud CDN. Signed URLs allow you to grant temporary access to specific resources without making your entire bucket public. Cloud CDN enhances the delivery speed by caching content at strategically located edge points around the globe.</p><p>Assuming you have already selected the project and activated Cloud Shell. Further, we will execute all of the commands in the cloud shell.</p><h4>Google Cloud Storage Bucket Creation</h4><p>Google Cloud Storage (GCS) is a scalable, fully managed object storage service for unstructured data. We start by creating a GCS bucket where you will store your files. A bucket name must be globally unique, and the location should be chosen to minimize latency for your users.</p><pre>#Replace BUCKET_NAME and BUCKET_LOCATION<br>gcloud storage buckets create gs://BUCKET_NAME --location=BUCKET_LOCATION<br>gcloud storage cp test.png gs://BUCKET_NAME</pre><p><strong>BUCKET_NAME</strong>: The name you choose for your Google Cloud Storage bucket. This must be globally unique and comply with GCS naming guidelines.</p><p><strong>BUCKET_LOCATION</strong>: The geographical location where your bucket will be created. Choose a location that is close to your users to minimize latency, e.g., us-central1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*ffGbdyPHjHirkx28UdDpSQ.png" /><figcaption>make sure your private bucket is created and uploaded a file for testing</figcaption></figure><p>If you try to access a private bucket object using a signed URL without using Cloud CDN. Every time it takes a constant time to access the bucket object. You can verify using <a href="https://www.uptrends.com/tools/cdn-performance-check">this tool</a></p><p>Assuming you already set the DNS zone for the domain and know how to attach the domain with a static IP. <a href="https://cloud.google.com/dns/docs/set-up-dns-records-domain-name#create_a_record_to_point_the_domain_to_an_external_ip_address">Click here</a> for step by step guide.</p><h4>Private key and certificate creation</h4><p>Select or create a private key, A Google Cloud SSL certificate includes both a private key and the certificate itself, both in PEM format.</p><pre># Generate a private key<br>openssl genrsa -out PRIVATE_KEY_FILE 2048</pre><h4>Create a certificate signing request (CSR)</h4><p>A Certificate Signing Request (CSR) contains information about your organization and domain. It’s used to request a certificate from a Certificate Authority (CA). For this tutorial, we create a self-signed certificate for testing purposes.</p><pre>#Create an OpenSSL configuration file</pre><pre>cat &lt;&lt;&#39;EOF&#39; &gt;CONFIG_FILE<br>[req]<br>default_bits = 2048<br>req_extensions = extension_requirements<br>distinguished_name = dn_requirements<br>prompt = no</pre><pre>[extension_requirements]<br>basicConstraints = CA:FALSE<br>keyUsage = nonRepudiation, digitalSignature, keyEncipherment<br>subjectAltName = @sans_list</pre><pre>[dn_requirements]<br>countryName = Country Name (2 letter code)<br>stateOrProvinceName = State or Province Name (full name)<br>localityName = Locality Name (eg, city)<br>0.organizationName = Organization Name (eg, company)<br>organizationalUnitName = Organizational Unit Name (eg, section)<br>commonName = Common Name (e.g. server FQDN or YOUR name. *.example.com)<br>emailAddress = Email Address</pre><pre>[sans_list]<br>DNS.1 = SUBJECT_ALTERNATIVE_NAME_1<br>DNS.2 = SUBJECT_ALTERNATIVE_NAME_2<br>EOF</pre><p><strong>CONFIG_FILE</strong>: The filename for the OpenSSL configuration file, e.g., openssl.cnf</p><p>Change values of <strong>dn_requirements</strong> Section</p><ul><li><strong>countryName</strong>: The 2-letter country code, e.g., US for the United States.</li><li><strong>stateOrProvinceName</strong>: The full name of the state or province, e.g., California.</li><li><strong>localityName</strong>: The name of the city, e.g., San Francisco.</li><li><strong>organizationName</strong>: The name of your organization or company, e.g., TechCorp.</li><li><strong>organizationalUnitName</strong>: The name of the organizational unit or department, e.g., IT Department.</li><li><strong>commonName</strong>: The fully qualified domain name (FQDN) or your name, e.g., <a href="http://www.example.com./">www.example.com.</a></li><li><strong>emailAddress</strong>: Your email address, e.g., admin@example.com.</li></ul><h4>Certificate Signing Request (CSR)</h4><p>We use the private key and the configuration file to create a CSR and using this CSR and Private key we will ask for a certificate from CA (certificate authority). We can also make a self-signed certificate, but the self-signed certificate is useful for internal testing and development before obtaining a CA-signed certificate for production use.</p><pre># Create a CSR using the private key and configuration file<br>openssl req -new -key PRIVATE_KEY_FILE -out CSR_FILE -config CONFIG_FILE</pre><p><strong>PRIVATE_KEY_FILE: </strong>The filename where the private key will be saved, e.g., private_key.pem.</p><p><strong>CONFIG_FILE</strong>: The filename for the OpenSSL configuration file, e.g., openssl.cnf</p><p><strong>CSR_FILE</strong>: The filename for the Certificate Signing Request, e.g., mycsr.csr</p><h4>Use your own internal CA</h4><p>If you manage your own CA, you can use it to sign your CSR. Using your CA to sign your CSR creates an <em>internally trusted</em> certificate when your clients have also been configured to trust your own CA. We will use this CERTIFICATE_FILE in the next step to create an SSL Certificate in GCP.</p><h4>Creating an SSL Certificate in GCP</h4><p>Google Cloud Platform (GCP) requires the SSL certificate and private key in PEM format to create an SSL certificate resource. This SSL certificate will be used to secure your application load balancer.</p><pre>gcloud compute ssl-certificates create SSL_CERTIFICATE_NAME \<br> --certificate=CERTIFICATE_FILE \<br> --private-key=PRIVATE_KEY_FILE \<br> --global</pre><p>Replace the following:</p><p><strong>SSL_CERTIFICATE_NAME:</strong> The name for the SSL certificate resource in GCP, e.g., my-ssl-cert</p><p><strong>CERTIFICATE_FILE:</strong> The path to the PEM-formatted certificate file, e.g., certificate.pem</p><p><strong>PRIVATE_KEY_FILE: </strong>The filename where the private key will be saved, e.g., private_key.pem</p><h4>Create an external Application Load Balancer with backend buckets</h4><p>An external load balancer distributes traffic across multiple backend buckets, improving the reliability and performance of your application. We will also add a signed URL key to the backend bucket for secure access.</p><pre># Reserve static IP<br>#and later attach a domain with this static IP<br>gcloud compute addresses create EXAMPLE_IP \<br> --network-tier=PREMIUM \<br> --ip-version=IPV4 \<br> --global<br><br># Configure the backend<br>gcloud compute backend-buckets create BACKEND_BUCKET_NAME \<br> --gcs-bucket-name=BUCKET_1_NAME --enable-cdn <br><br># Add signed URL key<br># we will use KEY_FILE_NAME and ANY_KEY_NAME to generat signed URL<br>head -c 16 /dev/random | base64 | tr +/ -_ &gt; KEY_FILE_NAME<br>gcloud compute backend-buckets add-signed-url-key BACKEND_BUCKET_NAME --key-file=KEY_FILE_NAME --key-name=KEY_NAME<br><br># Configure the URL map and target proxy<br>gcloud compute url-maps create https-lb --default-backend-bucket=BACKEND_BUCKET_NAME<br>gcloud compute target-https-proxies create https-lb-proxy --url-map=https-lb --ssl-certificates=SSL_CERTIFICATE_NAME<br><br># Configure the forwarding rule<br>gcloud compute forwarding-rules create https-lb-forwarding-rule --load-balancing-scheme=EXTERNAL_MANAGED \<br> --network-tier=PREMIUM --address=EXAMPLE_IP --global --target-https-proxy=https-lb-proxy --ports=443</pre><p><strong>EXAMPLE_IP</strong>: The name of the static IP address, e.g., my-static-ip.</p><p><strong>BACKEND_BUCKET_NAME</strong>: The name of the backend bucket to use with the load balancer, e.g., my-backend-bucket.</p><p><strong>BUCKET_1_NAME</strong>: The name of your private GCS bucket, e.g., my-bucket.</p><p><strong>KEY_FILE_NAME</strong>: The filename for the signed URL key, e.g., key-file.txt.</p><p><strong>KEY_NAME</strong>: Any name, that you want to assign to the signed URL key, The Same key name you have to use in the below command to generate a signed URL. e.g., my-key.</p><h3>Generating Signed URL</h3><p>Signed URLs provide a way to grant temporary access to your private GCS objects. You generate a signed URL using a pre-defined key and specify the expiration time. This URL can then be shared with authorized users.</p><pre># Generate a Signed URL and access the bucket object using it<br>gcloud compute sign-url &quot;URL&quot; --key-name KEY_NAME \<br> --key-file KEY_FILE_NAME --expires-in TIME_UNTIL_EXPIRATION</pre><p><strong>URL</strong>: The URL of the bucket object you want to access with the signed URL, e.g., https://&lt;www.example.com&gt;/my-bucket/test.png.</p><p><strong>TIME_UNTIL_EXPIRATION</strong>: The duration until the signed URL expires, specified in seconds, e.g., 3600.</p><p><strong>KEY_NAME</strong>: The name of the signed URL key, e.g., my-key.</p><p><strong>KEY_FILE_NAME</strong>: The filename of the key file created earlier, e.g., key-file.txt.</p><p>It will return a signed URL Copy the generated URL and paste it into your browser to securely access the specified GCS object.</p><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=084431d3ecd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Secure Your Flask App with Identity-Aware Proxy on Google App Engine]]></title>
            <link>https://medium.com/@muneer0692/how-to-secure-your-flask-app-with-identity-aware-proxy-on-google-app-engine-0bc83349a837?source=rss-39fe737ecebf------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bc83349a837</guid>
            <category><![CDATA[app-engine-deployment]]></category>
            <category><![CDATA[secure-app-with-iap]]></category>
            <category><![CDATA[app-engine-authentication]]></category>
            <category><![CDATA[iap-security]]></category>
            <dc:creator><![CDATA[Muneer Mansoori]]></dc:creator>
            <pubDate>Mon, 23 Sep 2024 06:19:58 GMT</pubDate>
            <atom:updated>2024-09-23T06:19:58.919Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xEgNxhyLbJesQ3YdA50Yfg.png" /></figure><p>In this guide, you’ll learn how to deploy a Flask application on Google App Engine and secure it using Identity-Aware Proxy (IAP). IAP ensures that only authorized users can access your app, adding an extra layer of security without changing your code. If you’re looking to boost the security of your cloud-hosted app effortlessly, this guide is for you.</p><h3>Prerequisites</h3><p>Before deploying your Flask app to Google App Engine, ensure the following prerequisites are met-</p><ul><li>Google Cloud SDK Installed</li><li>Required IAM Permissions (App Engine Deployer, Cloud Build Service Account, Storage Admin)</li><li>App Engine Initialized (if it’s not then you can via <em>gcloud app create</em>)</li></ul><p>Assuming you have enabled App Engine API.</p><p><strong>To get started, </strong>you’ll need three essential files: app.yaml, main.py, and requirements.txt. The app.yaml file configures the App Engine runtime, the main.py contains the actual Flask app, and requirements.txt lists all the necessary dependencies. Once these are in place, you can deploy your app using the command gcloud app deploy.</p><p><strong>app.yaml</strong></p><p>This is the configuration file for deploying your Flask app to Google App Engine. It defines the runtime, instance class, and environment.</p><pre>runtime: python310  # Google App Engine will use Python 3.10 runtime<br><br>instance_class: F1  # Defines the machine type<br><br>entrypoint: gunicorn -b :$PORT main:app  # Command to start the application<br><br>handlers:<br>  - url: /.*<br>    script: auto<br>    secure: always  # Enforce HTTPS</pre><p><em>The </em><em>app.yaml file is essential for configuring how Google App Engine runs your app. Here, we specify Python 3.10 as the runtime and set Gunicorn as the app&#39;s web server to handle HTTP requests. The </em><em>secure: always flag forces HTTPS, ensuring encrypted communication.</em></p><p><strong>main.py</strong><br>This file contains your Flask application code. Here’s a simple “Hello World” app.</p><pre>from flask import Flask<br><br>app = Flask(__name__)<br><br>@app.route(&#39;/&#39;)<br>def hello():<br>    return &#39;Hello, World! Securely deployed with IAP!&#39;</pre><p><em>This is the core of the application — a simple Flask app with a single route that returns a “Hello, World!” message. When deployed, this app will be accessible through the Google App Engine URL, and we will secure it using Identity-Aware Proxy (IAP).</em></p><p><strong>requirements.txt</strong><br>This file lists the necessary dependencies for your Flask app.</p><pre>Flask==2.2.5<br>gunicorn==20.1.0<br>Werkzeug==2.0.3  # Compatible version for Flask</pre><p><em>The </em><em>requirements.txt file defines the Python dependencies needed to run the application.</em></p><p>Now the files are ready, All the files should be in the same directory from where you are running <em>gcloud app deploy</em> command.<br>let’s deploy an application on the App engine.</p><pre># Authenticate your local machine with Google Cloud.<br>gcloud auth login<br><br># Set your Google Cloud project.<br># Replace [PROJECT_ID] with the actual ID of your Google Cloud project.<br>gcloud config set project [PROJECT_ID]<br><br># Deploy the application to Google App Engine.<br># The command uses the configuration defined in the app.yaml file.<br>gcloud app deploy<br><br>#This command opens your deployed Google App Engine application in the default web browser<br>gcloud app browse</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bs93oDdKRmbpa8ssvMWj-g.png" /></figure><p>Let’s verify and access deployed application from unauthorized users</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*T5e6HgrYj5eVgF5EyMY6QQ.png" /><figcaption>application is accessible from broswer incognito mode</figcaption></figure><p>By implementing Identity-Aware Proxy (IAP), you can effectively restrict access to specific applications or a set of applications within your Google Cloud environment. IAP allows you to define and manage access controls for individual users or groups, providing granular control over who can access each resource.</p><p>When a user attempts to access the application, they will be prompted with an authentication popup. If the user has been granted permission, they will gain access; otherwise, access will be denied. This mechanism ensures that only authorized individuals can interact with your applications, significantly enhancing your security posture.</p><p>Make sure you enabled <strong><em>Identity-Aware Proxy API</em></strong></p><p>Go to <strong><em>IAM and admin</em></strong> → <strong><em>Indentity-Aware Proxy</em></strong> →</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*2glGl55JkUcHIrgodzjfcg.png" /></figure><p>Enable this for App Engine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*ZnExY9jE36AIgBrIjpSoTQ.png" /></figure><p>After enabling this, if you will try to access the application without having permission, you will face the following issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*rt2f11qPMryP94xC7DfgJg.png" /><figcaption>when the user was not having permissions</figcaption></figure><p>Let’s provide the permission to user to access http endpoint of App Engine Application.</p><p>Go to <strong><em>IAM and admin</em></strong> → <strong><em>Indentity-Aware Proxy</em></strong> → <strong>Select Service</strong>(one or more) → <strong>Add principals </strong>→ <strong>enter user ID</strong> → Assign role: <strong>IAP-secured Web App User</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Izvk_y1aOlN9cdk-XkZagg.png" /></figure><p>After providing the access-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7IAIhhbP3s8HmdSAT47IOA.png" /></figure><p>Here you can see, we can access the application from authorized user</p><h3>Conclusion</h3><p>You’ve successfully deployed a Flask app on Google App Engine and secured it using Identity-Aware Proxy (IAP), ensuring that only authorized users can access it. IAP adds an extra layer of security without changing your code, making it ideal for protecting cloud-hosted applications. It’s a simple yet powerful way to manage access and safeguard your resources in Google Cloud.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bc83349a837" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In this blog we will see how to integrates the following technologies in one python program:]]></title>
            <link>https://medium.com/@muneer0692/in-this-blog-we-will-see-how-to-integrates-the-following-technologies-in-one-python-program-18e3157ffd1a?source=rss-39fe737ecebf------2</link>
            <guid isPermaLink="false">https://medium.com/p/18e3157ffd1a</guid>
            <dc:creator><![CDATA[Muneer Mansoori]]></dc:creator>
            <pubDate>Mon, 31 Jul 2023 11:41:29 GMT</pubDate>
            <atom:updated>2023-07-31T11:41:29.307Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog we will see how to integrates the following technologies in one python program:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u3_gmmnUJvXauxOF.png" /></figure><ol><li>Ansible</li><li>AWS</li><li>Docker</li><li>Hadoop</li><li>Machine Learning</li></ol><h3>MAIN MENU</h3><ul><li>Here user can select the Technology and move to Technology Main Menu</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/0*3yLLcgKC--lN7JoQ.png" /></figure><h3>ANSIBLE:</h3><ul><li>The menu program uses Ansible to automate tasks like configuring web servers, providing users with a seamless and efficient experience.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*OJWytHXrSdt8Yt2H.png" /><figcaption>AWS:</figcaption></figure><ul><li>AWS operations like create and run instances, create S3 buckets, uploading objects, attaching volumes are automated.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*GzdCgXYfKZGCluQD.png" /><figcaption>DOCKER:</figcaption></figure><ul><li>Docker operations like pull, run image, start and attach image, remove images and containers, copying files from base os to containers and vice versa are automated.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*3f9GEo7lOKQoBt9I.png" /><figcaption>HADOOP:</figcaption></figure><ul><li>Configured the system as hadoop datanode or namenode or client and start the service.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*zjQuuaAN0Chx247l.png" /></figure><h3>MACHINE LEARNING:</h3><ul><li>Configured Jupiter notebook in system and also in docker container for ML.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*HBGny2zA_mr4G0-e.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18e3157ffd1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Jenkins And How It’s working]]></title>
            <link>https://medium.com/@muneer0692/what-is-jenkins-and-how-its-working-1e8235c032d4?source=rss-39fe737ecebf------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e8235c032d4</guid>
            <dc:creator><![CDATA[Muneer Mansoori]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 12:44:36 GMT</pubDate>
            <atom:updated>2023-07-30T12:44:36.144Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*q8CquI5oeKWyc-2yBpwmcQ.png" /></figure><p>Introduction</p><p>In the fast-paced world of software development, automating the build, test, and deployment processes is crucial to achieving speed, efficiency, and reliability. Jenkins, an open-source automation server, has become a cornerstone in the DevOps ecosystem, enabling industries to streamline their Continuous Integration/Continuous Deployment (CI/CD) workflows. In this blog, we will explore how Jenkins works, its industry use cases, and its impact on software development.</p><p>What is Jenkins?</p><p>Jenkins is a highly extensible automation server that facilitates the automation of repetitive tasks in the software development lifecycle. As an integral part of CI/CD pipelines, Jenkins automates the building, testing, and deployment of software applications, ensuring a continuous flow of code changes into production.</p><p>How Jenkins Works</p><ol><li>Installation and Configuration: After installing Jenkins on a server or local machine, administrators configure it via a web-based interface. Jenkins integrates seamlessly with version control systems like Git, Subversion, or Mercurial.</li><li>Setting up Jobs: Jenkins organizes tasks into “jobs” or “builds.” Each job represents a specific step in the CI/CD process, such as building the application, running tests, and deploying the application to production.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*EMwTy5uSTnBPLmrA.png" /></figure><ol><li>Triggering Builds: Jenkins can be configured to trigger builds automatically whenever changes are pushed to the version control system (webhooks) or at scheduled intervals. Alternatively, builds can be started manually.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fk9r5PW5hgFY5odu.png" /></figure><ol><li>Build Steps: A build job consists of multiple build steps that define the actions to be performed. These steps can include compiling source code, running unit tests, generating reports, and packaging the application.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nLm-Wr8hJ2G7Tu6b.png" /></figure><ol><li>Build Artifacts: Jenkins generates build artifacts (e.g., binaries, executables, or packages) after a successful build, making them available for further stages in the CI/CD pipeline.</li><li>Testing: Jenkins enables automated testing by integrating with testing frameworks. Test results are collected and displayed in the Jenkins interface for analysis.</li><li>Deployment: Jenkins can be configured to deploy applications to different environments (e.g., development, staging, production) automatically or manually based on predefined criteria.</li><li>Integration with Other Tools: Jenkins offers a vast array of plugins, enabling integration with various tools and services, such as Docker, Kubernetes, SonarQube, Slack, and more.</li></ol><p>Industry Use Cases of Jenkins</p><ol><li>Continuous Integration and Deployment: Jenkins is widely used to automate the CI/CD process, ensuring that code changes are continuously integrated, tested, and deployed to production.</li><li>Automated Testing: Jenkins streamlines automated testing by running unit tests, integration tests, and regression tests with each code commit.</li><li>Scheduled Tasks: Jenkins can automate routine tasks, such as backup and database maintenance, reducing manual intervention and minimizing the risk of errors.</li><li>Code Quality and Analysis: Jenkins integrates with code analysis tools like SonarQube, ensuring continuous monitoring of code quality and identifying potential issues.</li><li>Release Management: Jenkins facilitates smooth release management by automating versioning, tagging, and packaging of software releases.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e8235c032d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Magic of Live Video Stream with Face Detection and Blurring using OpenCV]]></title>
            <link>https://medium.com/@muneer0692/the-magic-of-live-video-stream-with-face-detection-and-blurring-using-opencv-fb6c5811e4c2?source=rss-39fe737ecebf------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb6c5811e4c2</guid>
            <dc:creator><![CDATA[Muneer Mansoori]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 12:32:48 GMT</pubDate>
            <atom:updated>2023-07-30T12:32:48.679Z</atom:updated>
            <content:encoded><![CDATA[<p>Introduction</p><p>In the realm of computer vision, detecting and processing human faces from a live video stream opens up a world of exciting possibilities. In this blog, we will explore how to use OpenCV, a powerful computer vision library in Python, to detect human faces from a live video feed. We will then identify and blur the detected faces while keeping the rest of the video stream unchanged. The result? A fascinating application of face detection and blurring in real-time!</p><p>Prerequisites</p><p>Before we begin, ensure you have the following prerequisites:</p><ol><li>Python installed on your system (version 3.6 or higher).</li><li>Install the opencv-python library using pip install opencv-python.</li></ol><p>Building the Live Video Stream with Face Detection and Blurring</p><p>Step 1: Import the Required Modules</p><pre>import cv2</pre><p>Step 2: Load the Pre-Trained Face Detection Model</p><pre>face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + &#39;haarcascade_frontalface_default.xml&#39;)</pre><p>Step 3: Access the Live Video Stream and Process Frames</p><pre>video_capture = cv2.VideoCapture(0)  # Use 0 for the default camera, or specify the camera index if multiple cameras are connected<br><br>while True:<br>    ret, frame = video_capture.read()<br><br>    if not ret:<br>        break<br><br>    # Convert the frame to grayscale for faster processing<br>    gray_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)<br><br>    # Detect faces in the frame<br>    faces = face_cascade.detectMultiScale(gray_frame, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30), flags=cv2.CASCADE_SCALE_IMAGE)<br><br>    # Blur the detected faces and keep the rest of the frame unchanged<br>    for (x, y, w, h) in faces:<br>        face_roi = frame[y:y+h, x:x+w]<br>        face_roi = cv2.GaussianBlur(face_roi, (23, 23), 30)<br>        frame[y:y+h, x:x+w] = face_roi<br><br>    # Display the processed frame<br>    cv2.imshow(&#39;Video Stream&#39;, frame)<br><br>    # Exit the loop when &#39;q&#39; key is pressed<br>    if cv2.waitKey(1) &amp; 0xFF == ord(&#39;q&#39;):<br>        break<br><br># Release the video capture object and close the OpenCV windows<br>video_capture.release()<br>cv2.destroyAllWindows()</pre><p>Conclusion</p><p>By combining the power of OpenCV and face detection algorithms, we have unleashed the magic of live video stream processing with face detection and blurring. From real-time face detection to selectively blurring the detected faces while keeping the rest of the video stream unchanged, this application demonstrates the capabilities of computer vision in Python.</p><p>The journey of computer vision doesn’t end here. By exploring more advanced face recognition techniques, fine-tuning the blurring process, and integrating this application with other image processing features, you can take this project to new heights of innovation.</p><p>From enhancing privacy in video conferencing to creating captivating visual effects in video content, face detection and blurring have wide-ranging applications in various domains. Embrace the power of OpenCV and the world of computer vision to craft applications that transform the way we perceive and interact with visual information.</p><p>Happy coding and exploring the fascinating world of computer vision!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb6c5811e4c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[how to create image by yourself using arrays and Numpy]]></title>
            <link>https://medium.com/@muneer0692/how-to-create-image-by-yourself-using-arrays-and-numpy-c0150768e41?source=rss-39fe737ecebf------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0150768e41</guid>
            <dc:creator><![CDATA[Muneer Mansoori]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 12:28:19 GMT</pubDate>
            <atom:updated>2023-07-30T12:28:19.614Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/348/1*LPb48F2ls6Y-Cis7A4NZSg.jpeg" /></figure><p>Introduction</p><p>In the realm of digital artistry, creating images from scratch offers an exciting journey into the realm of creativity. In this blog, we will explore how to use arrays and NumPy, a powerful numerical computing library in Python, to generate captivating images. By leveraging the array manipulation capabilities of NumPy, we can craft visually stunning artwork with just a few lines of code.</p><p>Prerequisites</p><p>Before we begin, make sure you have the following prerequisites:</p><ol><li>Python installed on your system (version 3.6 or higher).</li><li>Install the numpy library using pip install numpy.</li></ol><p>Creating Images with Arrays and NumPy</p><p>Step 1: Import the Required Modules</p><pre>import numpy as np<br>import matplotlib.pyplot as plt</pre><p>Step 2: Set Image Dimensions and Create an Empty Canvas</p><pre># Define image dimensions<br>width = 800<br>height = 600<br><br># Create an empty canvas (an array of zeros) with the specified dimensions<br>image = np.zeros((height, width, 3), dtype=np.uint8)</pre><p>Step 3: Define Colors and Patterns</p><pre># Define colors using RGB values<br>white = (255, 255, 255)<br>red = (255, 0, 0)<br>green = (0, 255, 0)<br>blue = (0, 0, 255)<br><br># Draw basic shapes and patterns on the canvas<br>image[50:150, 50:150] = white  # Draw a white square<br>image[50:150, 200:300] = red   # Draw a red square<br>image[50:150, 350:450] = green # Draw a green square<br><br>image[200:300, 50:150] = red   # Draw a red rectangle<br>image[200:300, 200:300] = green # Draw a green rectangle<br>image[200:300, 350:450] = blue  # Draw a blue rectangle</pre><p>Step 4: Create Custom Patterns</p><pre># Create a custom pattern using NumPy slicing and indexing<br>pattern = np.array([[blue, white, blue],<br>                    [white, blue, white],<br>                    [blue, white, blue]])<br><br>image[350:350+pattern.shape[0], 50:50+pattern.shape[1]] = pattern<br></pre><p>Step 5: Display and Save the Image</p><pre># Display the image using matplotlib<br>plt.imshow(image)<br>plt.axis(&#39;off&#39;)<br>plt.show()<br><br># Save the image as a file<br>plt.imsave(&#39;custom_image.png&#39;, image)</pre><p>Conclusion</p><p>Creating images from scratch using arrays and NumPy is an exciting adventure into the world of digital artistry. With just a few lines of code, we can generate visually appealing patterns, shapes, and designs. By manipulating arrays and harnessing the power of NumPy, we unleash the artistry within us and craft captivating images limited only by our imagination.</p><p>As you delve deeper into the art of image creation with arrays and NumPy, you will discover endless possibilities to express your creativity. From custom patterns and abstract designs to intricate compositions, the canvas is yours to explore and transform into masterpieces.</p><p>Embrace the beauty of array manipulation and NumPy’s numerical prowess to breathe life into your visual concepts. The journey of image creation has just begun, and with each stroke of code, you can unveil a universe of artistic expression that is uniquely yours. Happy coding and happy crafting!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0150768e41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Combining and Swapping Images with Python]]></title>
            <link>https://medium.com/@muneer0692/combining-and-swapping-images-with-python-72f85fc378b2?source=rss-39fe737ecebf------2</link>
            <guid isPermaLink="false">https://medium.com/p/72f85fc378b2</guid>
            <dc:creator><![CDATA[Muneer Mansoori]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 08:10:52 GMT</pubDate>
            <atom:updated>2023-07-30T08:10:52.896Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*fwy-jkeYD9dPQI1bbsBgZQ.jpeg" /></figure><p>Introduction</p><p>In the digital era, image manipulation has become a fascinating art form, allowing us to create unique compositions and experiment with visual elements. In this blog, we will explore how to use Python to take two images and combine them to form a single image, as well as how to crop and swap specific parts of both images. By harnessing the power of Python’s image processing libraries, we can unlock a world of creative possibilities.</p><p>Prerequisites</p><p>Before we dive into the code, make sure you have the following prerequisites:</p><ol><li>Python installed on your system (version 3.6 or higher).</li><li>Install the opencv-python library using pip install opencv-python.</li><li>Two images to work with (you can use any images of your choice).</li></ol><p>Combining Two Images</p><p>Step 1: Import the Required Modules</p><pre>import cv2<br>import numpy as np</pre><p>Step 2: Load and Resize Images</p><pre>image1 = cv2.imread(&#39;image1.jpg&#39;)  # Replace with the path to your first image<br>image2 = cv2.imread(&#39;image2.jpg&#39;)  # Replace with the path to your second image<br><br># Ensure both images have the same dimensions for proper blending<br>image2 = cv2.resize(image2, (image1.shape[1], image1.shape[0]))</pre><p>Step 3: Combine Images</p><pre>combined_image = cv2.addWeighted(image1, 0.5, image2, 0.5, 0)</pre><p>Step 4: Display and Save the Result</p><pre>cv2.imshow(&#39;Combined Image&#39;, combined_image)<br>cv2.waitKey(0)<br>cv2.destroyAllWindows()<br><br>cv2.imwrite(&#39;combined_image.jpg&#39;, combined_image)</pre><p>Swapping Cropped Parts of Two Images</p><p>Step 1: Crop Image Regions</p><pre>crop_region1 = image1[100:300, 200:400]<br>crop_region2 = image2[150:350, 250:450]</pre><p>Step 2: Swap Cropped Regions</p><pre>image1[100:300, 200:400] = crop_region2<br>image2[150:350, 250:450] = crop_region1</pre><p>Step 3: Display and Save the Swapped Images</p><pre>cv2.imshow(&#39;Swapped Image 1&#39;, image1)<br>cv2.imshow(&#39;Swapped Image 2&#39;, image2)<br>cv2.waitKey(0)<br>cv2.destroyAllWindows()<br><br>cv2.imwrite(&#39;swapped_image1.jpg&#39;, image1)<br>cv2.imwrite(&#39;swapped_image2.jpg&#39;, image2)</pre><p>Conclusion</p><p>Image manipulation in Python opens up a world of creative possibilities, allowing us to combine and swap elements to create unique compositions. In this blog, we explored how to take two images and combine them to form a single image, as well as how to crop specific parts of both images and swap them.</p><p>By leveraging Python’s image processing libraries, we can delve deeper into the art of image manipulation, experimenting with various techniques to produce visually stunning results. Whether it’s creating collages, morphing images, or applying artistic filters, Python empowers us to unleash our creativity and craft captivating visual experiences.</p><p>With the knowledge gained from this blog, you have the foundation to embark on exciting image manipulation projects, sparking curiosity and inspiring creativity in the world of digital artistry. Happy image tinkering!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72f85fc378b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Live Streaming Video Chat App with Python’s cv2 Module: Voiceless Communication at Its…]]></title>
            <link>https://medium.com/@muneer0692/building-a-live-streaming-video-chat-app-with-pythons-cv2-module-voiceless-communication-at-its-e2b914e99d60?source=rss-39fe737ecebf------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2b914e99d60</guid>
            <dc:creator><![CDATA[Muneer Mansoori]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 08:06:35 GMT</pubDate>
            <atom:updated>2023-07-30T08:06:35.355Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a Live Streaming Video Chat App with Python’s cv2 Module: Voiceless Communication at Its Best</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VgmzbMTfMJMr-cY8hM2sJQ.jpeg" /></figure><p>Introduction</p><p>In today’s digital world, video communication has become an integral part of our lives. In this blog, we will explore how to create a live streaming video chat app without voice using the cv2 (OpenCV) module in Python. By combining the power of computer vision and networking, we can build a simple yet effective video chat application for seamless visual communication.</p><p>Prerequisites</p><p>Before we dive into the code, ensure you have the following prerequisites:</p><ol><li>Python installed on your system (version 3.6 or higher).</li><li>cv2 (OpenCV) module installed. If not, install it using pip install opencv-python.</li><li>A stable internet connection.</li></ol><p>Building the Video Chat App</p><p>Step 1: Import the Required Modules</p><pre>import cv2<br>import socket<br>import pickle<br>import struct</pre><p>Step 2: Create the Server and Client</p><pre># Server<br>server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br>host_name = socket.gethostname()<br>host_ip = socket.gethostbyname(host_name)<br>print(&#39;HOST IP:&#39;, host_ip)<br>port = 9999<br>socket_address = (host_ip, port)<br><br>server_socket.bind(socket_address)<br>server_socket.listen(5)<br>print(&quot;LISTENING AT:&quot;, socket_address)</pre><pre># Client<br>client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br>host_ip = &#39;192.168.0.100&#39;  # Replace with the server IP address<br>port = 9999<br>client_socket.connect((host_ip, port))<br>data = b&quot;&quot;<br>payload_size = struct.calcsize(&quot;Q&quot;)</pre><p>Step 3: Start the Video Stream</p><pre>while True:<br>    while len(data) &lt; payload_size:<br>        packet = client_socket.recv(4*1024)<br>        if not packet:<br>            break<br>        data += packet<br>    packed_msg_size = data[:payload_size]<br>    data = data[payload_size:]<br>    msg_size = struct.unpack(&quot;Q&quot;, packed_msg_size)[0]<br>    <br>    while len(data) &lt; msg_size:<br>        data += client_socket.recv(4*1024)<br>    frame_data = data[:msg_size]<br>    data = data[msg_size:]<br>    <br>    frame = pickle.loads(frame_data)<br>    cv2.imshow(&quot;VIDEO&quot;, frame)<br>    key = cv2.waitKey(1) &amp; 0xFF<br>    if key == ord(&#39;q&#39;):<br>        client_socket.close()<br>        break</pre><p>Step 4: Capture and Stream Video</p><pre>vid = cv2.VideoCapture(0)<br><br>while True:<br>    ret, frame = vid.read()<br>    frame = cv2.resize(frame, (640, 480))<br>    a = pickle.dumps(frame)<br>    message = struct.pack(&quot;Q&quot;, len(a))+a<br>    client_socket.sendall(message)<br>    <br>    cv2.imshow(&#39;TRANSMITTING VIDEO&#39;, frame)<br>    key = cv2.waitKey(1) &amp; 0xFF<br>    if key == ord(&#39;q&#39;):<br>        client_socket.close()<br>        break</pre><p>Conclusion</p><p>In this blog, we explored how to create a live streaming video chat app without voice using Python’s cv2 module. By establishing a connection between the server and client, capturing and streaming video frames, we achieved a basic yet functional video chat application. This voiceless communication approach can be further enhanced by integrating voice functionality, user authentication, and other features to create a more comprehensive video chat platform.</p><p>With the power of Python’s cv2 module and networking capabilities, you have the potential to build a scalable and versatile video communication solution that caters to a wide range of applications, from online conferencing to remote collaboration and beyond. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2b914e99d60" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>