<?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 Pawan Phalak on Medium]]></title>
        <description><![CDATA[Stories by Pawan Phalak on Medium]]></description>
        <link>https://medium.com/@pawanphalak?source=rss-c45090f2a6ab------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*har05m3tZHGSJaEfaKll-Q.jpeg</url>
            <title>Stories by Pawan Phalak on Medium</title>
            <link>https://medium.com/@pawanphalak?source=rss-c45090f2a6ab------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 08:33:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pawanphalak/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[TLS and mTLS connection with GCP Application Load Balancer]]></title>
            <link>https://medium.com/google-cloud/tls-and-mtls-connection-with-gcp-application-load-balancer-6e2cd5189707?source=rss-c45090f2a6ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e2cd5189707</guid>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[mutual-tls]]></category>
            <category><![CDATA[gcp-security-operations]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[gcp-load-balancer]]></category>
            <dc:creator><![CDATA[Pawan Phalak]]></dc:creator>
            <pubDate>Tue, 18 Jun 2024 12:49:08 GMT</pubDate>
            <atom:updated>2025-02-14T02:32:48.491Z</atom:updated>
            <content:encoded><![CDATA[<p>The GCP Application Load Balancer is a layer 7 load balancer that is commonly used to implement HTTPS communication. The authentication in this case is one-way, meaning that the client verifies the identity of the server.</p><p>In addition, GCP Application Load balancer can utilize mutual TLS (mTLS) to verify the identity of clients that connect to it. During the TLS handshake, the mTLS connection at the load balancer requests the client to send a certificate and authenticate itself. This helps to ensure that only trusted clients communicate with the load balancer’s backend applications. The GCP Application Load Balancer supports frontend mTLS, which terminates the mTLS connection at the load balancer itself and performs client certificate validation at the load balancer frontend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B8dqtYKNlc4LEYtDaLPIOw.png" /><figcaption>mTLS with GCP Application Load Balancer</figcaption></figure><blockquote><strong>Note: The following setup is tested with GCP Application load balancer(EXTERNAL_MANAGED) and only covers detailed steps to generate the self signed certificates to configure the mTLS with load balancer. The complete automated setup of tls and mTLS can be found </strong><a href="https://github.com/GoogleCloudPlatform/professional-services/tree/main/examples/gclb-mtls-tls"><strong>here</strong></a><strong>.</strong></blockquote><p>The following are the GCP resources that must be configured to implement the mTLS setup with GCP Application Load Balancer:</p><ol><li><strong>ServerTlsPolicy<br></strong>Server TLS policies is attached to the target HTTPS proxy resource of the load balancer. This resource allows the server-side TLS mode and the TrustConfig resource to use when validating client certificates.</li><li><strong>Trust Config<br></strong>This is a <a href="https://cloud.google.com/certificate-manager/docs/overview">Certificate Manager</a> resource. TrustConfig contains a single trust store resource that is used to validate client certificates.</li><li><strong>Trust Store</strong><br>This contains the trust anchor and intermediate certificate authority (CA) certificates that are used to validate the client certificate chain.</li></ol><blockquote>The GCP Application Load Balancer frontend mTLS architecture overview is covered in detail <a href="https://cloud.google.com/load-balancing/docs/mtls">here</a>.</blockquote><p>This article will describe the detailed steps necessary to generate self-signed certificates and configure a GCP Application Load Balancer to accept a strict mutual TLS (mTLS) connection.</p><p>Certificates used for the mTLS configurations must be generated with the certificate requirements outlined <a href="https://cloud.google.com/load-balancing/docs/mtls#certificate-requirements">here</a>. The following steps detail how to generate sample certificates that adhere to the certificate requirements:</p><ol><li>Create root certificate:</li></ol><pre># Create root.conf:<br>cat &lt;&lt; EOF &gt; root.conf<br>[req]<br>default_bits              = 2048<br>req_extensions            = extension_requirements<br>distinguished_name        = dn_requirements<br>prompt                    = no<br><br>[extension_requirements]<br>basicConstraints          = critical,CA:TRUE<br>keyUsage                  = keyCertSign<br><br>[dn_requirements]<br>countryName               = IN<br>stateOrProvinceName       = Telangana<br>localityName              = Hyderabad<br>0.organizationName        = Google<br>organizationalUnitName    = IT<br>commonName                = root<br>EOF<br><br># Generate the root certificate using the root.conf file:<br>openssl req -x509 \<br>-new -sha256 -newkey rsa:2048 -nodes \<br>-days 3650 \<br>-config root.conf \<br>-extensions extension_requirements \<br>-keyout root.key -out root.cert</pre><p>2. Create csr for intermediate certificate 1</p><pre># Create int.conf<br>cat &lt;&lt; EOF &gt; int.conf<br>[req]<br>default_bits              = 2048<br>req_extensions            = extension_requirements<br>distinguished_name        = dn_requirements<br>prompt                    = no<br><br>[extension_requirements]<br>basicConstraints          = critical,CA:TRUE<br>keyUsage                  = keyCertSign<br><br>[dn_requirements]<br>countryName               = IN<br>stateOrProvinceName       = Telangana<br>localityName              = Hyderabad<br>0.organizationName        = Google<br>organizationalUnitName    = IT<br>commonName                = int<br>EOF<br><br># Create csr for first intermediate certificate with the int.conf file: <br>openssl req \<br>-new -sha256 -newkey rsa:2048 -nodes \<br>-config int.conf \<br>-extensions extension_requirements \<br>-keyout int.key -out int.req</pre><p>3. Create intermediate certificate 1</p><pre>openssl x509 -req \<br>-CAkey root.key -CA root.cert \<br>-set_serial 1 \<br>-days 3650 \<br>-extfile int.conf \<br>-extensions extension_requirements \<br>-in int.req -out int.cert</pre><p>4. Create csr for intermediate certificate 2</p><pre># Create int2.conf file:<br>cat &lt;&lt; EOF &gt; int2.conf<br>[req]<br>default_bits              = 2048<br>req_extensions            = extension_requirements<br>distinguished_name        = dn_requirements<br>prompt                    = no<br><br>[extension_requirements]<br>basicConstraints          = critical,CA:TRUE<br>keyUsage                  = keyCertSign<br><br>[dn_requirements]<br>countryName               = IN<br>stateOrProvinceName       = Telangana<br>localityName              = Hyderabad<br>0.organizationName        = Google<br>organizationalUnitName    = IT<br>commonName                = int2<br>EOF<br><br># Generate the csr for a second intermediate certificate:<br>openssl req \<br>-new -sha256 -newkey rsa:2048 -nodes \<br>-config int2.conf \<br>-extensions extension_requirements \<br>-keyout int2.key -out int2.req</pre><p>5. Create intermediate certificate 2</p><pre>openssl x509 -req \<br>-CAkey int.key -CA int.cert \<br>-set_serial 1 \<br>-days 3650 \<br>-extfile int2.conf \<br>-extensions extension_requirements \<br>-in int2.req -out int2.cert</pre><p>6. Generate server certificates:</p><pre># Create server.conf file:<br>cat &lt;&lt; EOF &gt; server.conf<br>[req]<br>default_bits              = 2048<br>req_extensions            = extension_requirements<br>distinguished_name        = dn_requirements<br>prompt                    = no<br><br>[extension_requirements]<br>basicConstraints          = CA:FALSE<br>keyUsage                  = nonRepudiation, digitalSignature, keyEncipherment<br>extendedKeyUsage          = serverAuth,clientAuth<br>subjectAltName            = DNS:test-domain.com,DNS:www.test-domain.com<br><br>[dn_requirements]<br>countryName               = IN<br>stateOrProvinceName       = Telangana<br>localityName              = Hyderabad<br>0.organizationName        = Google<br>organizationalUnitName    = DEV<br>commonName                = test-domain.com<br>EOF<br><br># Generate the CSR for creating a server certificate:<br>openssl req -new -keyout server.key -out server.csr -config server.conf<br><br># Generate the Server Certificate:<br>openssl x509 -req -in server.csr -out server.cert \<br> -extfile server.conf -extensions extension_requirements \<br> -days 365 -CA int2.cert -CAkey int2.key</pre><p>7. Generate client certificate:</p><pre># Create client.conf<br>cat &lt;&lt; EOF &gt; client.conf<br>[req]<br>default_bits              = 2048<br>req_extensions            = extension_requirements<br>distinguished_name        = dn_requirements<br>prompt                    = no<br><br>[extension_requirements]<br>basicConstraints          = CA:FALSE<br>keyUsage                  = nonRepudiation, digitalSignature, keyEncipherment<br>extendedKeyUsage          = serverAuth,clientAuth<br>subjectAltName            = DNS:test-client.com,DNS:www.test-client.com<br><br>[dn_requirements]<br>countryName               = IN<br>stateOrProvinceName       = Telangana<br>localityName              = Hyderabad<br>0.organizationName        = Google<br>organizationalUnitName    = QA<br>commonName                = test-client<br>EOF<br><br># Generate CSR for client certificate:<br>openssl req -new -keyout client.key -out client.csr -config client.conf<br><br># Generate the client certificates:<br>openssl x509 -req -in client.csr -out client.cert \<br> -extfile client.conf -extensions extension_requirements \<br> -days 365 -CA int2.cert -CAkey int2.key</pre><p>8. Once all the certificates are generated, these certificates can be used to create the trust config and network security resources with the steps mentioned <a href="https://cloud.google.com/load-balancing/docs/https/setting-up-mtls-ccm#trustconfig">here</a>.</p><p>9. In order to execute the strict mTLS mode, the server TLS policy must be created with the clientValidationMode key set to REJECT_INVALID. This will ensure that only requests that provide a client certificate that can be validated against a TrustConfig resource are passed to the backend.</p><p>10. It is also possible to configure mTLS custom headers for the load balancer with any of the headers listed <a href="https://cloud.google.com/load-balancing/docs/mtls#custom-header-error">here</a>. Custom headers are passed to the backend when the clientValidationMode is set to ALLOW_INVALID_OR_MISSING_CLIENT_CERT or the client certificate successfully passes certificate validation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e2cd5189707" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/tls-and-mtls-connection-with-gcp-application-load-balancer-6e2cd5189707">TLS and mTLS connection with GCP Application Load Balancer</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running Cloud SQL Auth Proxy on GKE: Deployment vs Jobs]]></title>
            <link>https://medium.com/google-cloud/running-cloud-sql-auth-proxy-on-gke-deployment-vs-jobs-aa90c6b08b76?source=rss-c45090f2a6ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa90c6b08b76</guid>
            <category><![CDATA[cloud-sql]]></category>
            <category><![CDATA[cloud-sql-proxy]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[gke]]></category>
            <dc:creator><![CDATA[Pawan Phalak]]></dc:creator>
            <pubDate>Sat, 24 Jun 2023 13:18:13 GMT</pubDate>
            <atom:updated>2023-06-26T07:30:52.333Z</atom:updated>
            <content:encoded><![CDATA[<p>The <strong>Cloud SQL Auth proxy</strong> is a Cloud SQL connector which can be used to connect to a Cloud SQL instance from a GKE cluster. More details about the working of <strong>Cloud SQL Auth proxy</strong> can be found <a href="https://cloud.google.com/sql/docs/mysql/sql-proxy#how-works">here</a>.</p><p>The GKE cluster can have both kubernetes <strong>deployment</strong> and <strong>jobs</strong> running the application workload which requires to establish a secure connection using cloud sql auth proxy.</p><p>It is <strong>recommended</strong> to run the cloud sql auth proxy in a side car pattern, primarily to avoid exposing the SQL traffic locally within the cluster. More details on running the cloud sql auth proxy in sidecar pattern can be found <a href="https://cloud.google.com/sql/docs/mysql/connect-kubernetes-engine#run_the_in_a_sidecar_pattern">here</a>.</p><p>The kubernetes jobs or deployment should be configured with <strong>workload identity</strong> to allow connecting to Cloud SQL with the IAM User acting as a database user. More details to configure workload identity for the service account attached to application workload(Deployment/Jobs) can be found <a href="https://cloud.google.com/sql/docs/mysql/connect-kubernetes-engine#workload-identity">here</a>.</p><h4><strong>Cloud SQL Auth proxy sidecar configurations for Kubernetes Deployment</strong></h4><p>Following is a sample sidecar configuration to run a cloud sql auth proxy with kubernetes deployment:</p><pre>- name: cloud-sql-proxy<br>  # It is recommended to use the latest version of the Cloud SQL Auth Proxy<br>  # Make sure to update on a regular schedule!<br>  image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.1.0<br>  args:<br>    # If connecting from a VPC-native GKE cluster, you can use the<br>    # following flag to have the proxy connect over private IP<br>    # - &quot;--private-ip&quot;<br><br>    # Enable structured logging with LogEntry format:<br>    - &quot;--structured-logs&quot;<br><br>    # Replace DB_PORT with the port the proxy should listen on<br>    - &quot;--port=&lt;DB_PORT&gt;&quot;<br>    - &quot;&lt;INSTANCE_CONNECTION_NAME&gt;&quot;<br><br>  securityContext:<br>    # The default Cloud SQL Auth Proxy image runs as the<br>    # &quot;nonroot&quot; user and group (uid: 65532) by default.<br>    runAsNonRoot: true<br>  # You should use resource requests/limits as a best practice to prevent<br>  # pods from consuming too many resources and affecting the execution of<br>  # other pods. You should adjust the following values based on what your<br>  # application needs. For details, see<br>  # https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/<br>  resources:<br>    requests:<br>      # The proxy&#39;s memory use scales linearly with the number of active<br>      # connections. Fewer open connections will use less memory. Adjust<br>      # this value based on your application&#39;s requirements.<br>      memory: &quot;2Gi&quot;<br>      # The proxy&#39;s CPU use scales linearly with the amount of IO between<br>      # the database and the application. Adjust this value based on your<br>      # application&#39;s requirements.<br>      cpu:    &quot;1&quot;</pre><h4>Cloud SQL Auth proxy sidecar configurations for Kubernetes Job</h4><p>The kubernetes job requires additional configurations to work with cloud sql auth proxy in side car pattern. Since the side car should also exit once the main container is completed for the kubernetes job. We can add a custom configuration to exit the sidecar container once the main container exits. This is done by mounting a emptyDir volume for the job and the main container creates a file after completing the main container, this change is read by the sidecar container to then exit on the main container completion. Add following configuration to add emptyDir volume to the job:</p><pre>volumes:<br>- name: tmp-pod<br>  emptyDir: {}</pre><p>Following configuration should be added in main container to write to the file in mounted volume after the main container completes:</p><pre>args:<br>  - |<br>    &lt;MAIN_CONTAINER_ARGS&gt;<br>    trap &quot;touch /tmp/pod/terminated&quot; EXIT<br>volumeMounts:<br>  - mountPath: /tmp/pod<br>    name: tmp-pod</pre><p>Following configuration is for the cloud sql auth proxy which also read the mounted volume path for the file which gets updated after the main container exists. The side car container exits after detecting the file written by main container and the kubernetes job successfully completes with both main and sidecar container exiting.</p><pre>- name: cloud-sql-proxy<br>  image: &quot;gcr.io/cloudsql-docker/gce-proxy:1.33.8-buster&quot;<br>  command: [&quot;/bin/sh&quot;, &quot;-c&quot;]<br>  args:<br>    - |<br>      ./cloud_sql_proxy -instances=&lt;INSTANCE_CONNECTION_NAME&gt;=tcp:5432 -structured_logs -enable_iam_login &amp; CHILD_PID=$!<br>        (while true; do if [[ -f &quot;/tmp/pod/terminated&quot; ]]; then kill $CHILD_PID; echo &quot;Killed $CHILD_PID because the main container terminated.&quot;; fi; sleep 1; done) &amp;<br>        wait $CHILD_PID<br>        if [[ -f &quot;/tmp/pod/terminated&quot; ]]; then exit 0; echo &quot;Job completed. Exiting...&quot;; fi<br>  volumeMounts:<br>    - mountPath: /tmp/pod<br>      name: tmp-pod<br>      readOnly: true</pre><p>The above configuration allows connecting to cloud sql from both kubernetes job and deployment securely using the cloud sql auth proxy in a sidecar pattern.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa90c6b08b76" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/running-cloud-sql-auth-proxy-on-gke-deployment-vs-jobs-aa90c6b08b76">Running Cloud SQL Auth Proxy on GKE: Deployment vs Jobs</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deployment on GKE with Flagger using GCP Log Based Metrics]]></title>
            <link>https://medium.com/google-cloud/deployment-on-gke-with-flagger-using-gcp-log-based-metrics-9daf951348d1?source=rss-c45090f2a6ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/9daf951348d1</guid>
            <category><![CDATA[flagger]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[gke]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Pawan Phalak]]></dc:creator>
            <pubDate>Tue, 15 Nov 2022 10:37:22 GMT</pubDate>
            <atom:updated>2022-11-17T10:49:32.531Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Overview</strong></h4><p>Flagger is a progressive delivery tool that converts the release process for applications using Kubernetes to automatic operation. The flagger tool can be used to execute deployment strategy(canary, A/B, blue-green). The flagger deployment is executed with the metric analysis stage. We can use GCP log based metrics to define the custom metrics which can be used to control the deployment in GKE cluster. In this blog, we will cover how to use flagger tool to perform canary deployment using GCP logs based metrics as flagger metrics.</p><h4>Prerequisites</h4><ol><li>GKE Cluster with Istio installed and workload identity enabled.</li><li>Flagger requires a Kubernetes cluster <strong>v1.16</strong> or newer and Istio <strong>v1.5</strong> or newer.</li><li><a href="https://www.caseywylie.io/kubernetes/configure-istio-accesslog/">Enable Istio access logs of type JSON.</a></li><li><a href="https://istio.io/latest/docs/setup/platform-setup/gke/?_ga=2.93334686.242401394.1668493301-1767011036.1668493301#:~:text=For%20private%20GKE%20clusters">Update the GKE cluster firewall to open port 15017 for private GKE Cluster.</a></li></ol><h4>Steps</h4><ol><li>Install flagger on GKE cluster with following command in istio-system namespace:</li></ol><pre>kubectl apply -k github.com/fluxcd/flagger//kustomize/istio</pre><p>2. Deploy sample application with testing pods in test namespace:</p><pre>kubectl create ns test<br>kubectl label namespace test istio-injection=enabled<br>kubectl apply -k https://github.com/fluxcd/flagger//kustomize/podinfo?ref=main<br>kubectl apply -k https://github.com/fluxcd/flagger//kustomize/tester?ref=main</pre><p>3. Expose the sample application with ingress gateway:</p><pre>apiVersion: networking.istio.io/v1alpha3<br>kind: Gateway<br>metadata:<br>  name: public-gateway<br>  namespace: istio-system<br>spec:<br>  selector:<br>    istio: ingressgateway<br>  servers:<br>    - port:<br>        number: 80<br>        name: http<br>        protocol: HTTP<br>      hosts:<br>        - &quot;*&quot;</pre><p>4. Create a log based metric of type distribution with the following cloud logging query to get the latency of canary pods(using field named jsonPayload.duration) of sample application from istio access logs:</p><pre>resource.type=&quot;k8s_container&quot;<br>resource.labels.project_id=&quot;&lt;GCP_PROJECT_ID&gt;&quot;<br>resource.labels.location=&quot;&lt;GKE_LOCATION&gt;&quot;<br>resource.labels.cluster_name=&quot;&lt;GKE_CLUSTER_NAME&gt;&quot;<br>resource.labels.namespace_name=&quot;test&quot;<br>resource.labels.container_name=&quot;istio-proxy&quot;<br>jsonPayload.authority=&quot;podinfo-canary.test:9898&quot;<br>jsonPayload.duration&gt;0</pre><p>5. Create service account(GCP_SA) with Monitoring Admin role from GCP IAM page.</p><p>6. Perform following steps in workload identity enabled GKE cluster:</p><p>a) Add IAM policy binding between the flagger service account and GCP service account. This binding allows the flagger Kubernetes service account to act as the IAM service account:</p><pre>gcloud iam service-accounts add-iam-policy-binding &lt;GCP_SA&gt; \    <br>--role roles/iam.workloadIdentityUser \<br>--member &quot;serviceAccount:&lt;GCP_PROJECT_ID&gt;.svc.id.goog[&lt;NAMESPACE&gt;/&lt;FLAGGER_KUBERNETES_SA&gt;]&quot;</pre><p>b) Annotate the flagger Kubernetes service account:</p><pre>kubectl annotate serviceaccount &lt;FLAGGER_KUBERNETES_SA&gt; \<br>--namespace &lt;NAMESPACE&gt; \<br>iam.gke.io/gcp-service-account=&lt;GCP_SA&gt;</pre><p>7. Create metric template with GCP log based metric to fetch latency from GCP log based metric created in step 4.</p><pre>apiVersion: flagger.app/v1beta1<br>kind: MetricTemplate<br>metadata:<br>  name: canary-latency<br>  namespace: test<br>spec:<br>  provider:<br>    type: stackdriver<br>    secretRef: <br>      name: gcloud-sa<br>  query: |<br>    fetch k8s_container<br>    | metric &#39;logging.googleapis.com/user/podinfo-canary-latency&#39;<br>    | every 1m<br>    | group_by [], <br>        [value_response_latencies_percentile:<br>            percentile(value.latency,99 )]</pre><p>8. Create a kubernetes secret with gcloud project ID:</p><pre>kubectl create secret generic gcloud-sa --from-literal=project=&lt;project-id&gt; -n test</pre><p>9. Apply the canary YAML file with following configurations, update the hosts and gateway parameter in the manifest, if required:</p><pre>apiVersion: flagger.app/v1beta1<br>kind: Canary<br>metadata:<br>  name: podinfo<br>  namespace: test<br>spec:<br>  # deployment reference<br>  targetRef:<br>    apiVersion: apps/v1<br>    kind: Deployment<br>    # Mention the deployment name for which Canary has to be triggered<br>    name: podinfo<br>  service:<br>    # service port number<br>    port: 9898<br>    # container port number or name (optional)<br>    targetPort: 9898<br>    # Istio gateways (optional)<br>    gateways:<br>    - public-gateway.istio-system.svc.cluster.local<br>    - istio-ingressgateway<br>    # Istio virtual service host names (optional)<br>    hosts:<br>    # - app.example.com<br>    - &quot;*&quot;<br>    # Istio traffic policy (optional)<br>    trafficPolicy:<br>      tls:<br>        # use ISTIO_MUTUAL when mTLS is enabled<br>        mode: DISABLE<br>  analysis:<br>    # schedule interval (default 60s)<br>    interval: 30s<br>    # max number of failed metric checks before rollback<br>    threshold: 10<br>    # max traffic percentage routed to canary<br>    # percentage (0-100)<br>    maxWeight: 100<br>    # canary increment step<br>    # percentage (0-100)<br>    stepWeight: 5<br>    match:<br>      - headers:<br>          cookie:<br>            regex: &quot;^(.*?;)?(type=insider)(;.*)?$&quot;<br>    metrics:<br>      - name: &quot;GCP log based metrics for canary podinfo&quot;<br>        templateRef:<br>          name: canary-latency<br>          namespace: test<br>        thresholdRange:<br>          max: 100<br>        interval: 30s<br>    webhooks:<br>      - name: load-test<br>        url: http://flagger-loadtester.test/<br>        timeout: 15s<br>        metadata:<br>          cmd: &quot;hey -z 10m -q 10 -c 2 -H &#39;Cookie: type=insider&#39; http://podinfo-canary.test:9898/&quot;<br>      - name: &quot;promotion gate&quot;<br>        type: confirm-promotion<br>        url: http://flagger-loadtester.test/gate/approve</pre><p><em>NOTE: </em><a href="https://docs.flagger.app/usage/how-it-works"><em>Configure each parameter of canary YAML file as per requirement.</em></a></p><p>10. Trigger the canary deployment by updating the image version of sample application:</p><pre>kubectl -n test set image deployment/podinfo podinfod=stefanprodan/podinfo:6.0.1</pre><p>11. Once the canary is initialized, the canary roll-out will start and the new version of deployment will be rolled out in the increments of weight 5, if the metric analysis is succeeded.</p><p>12. The metric analysis of canary checks if the latency from the GCP log based metric is below 100 threshold value for new canary version. If the metric analysis condition is true, then the canary rollout is incremented by step 5. The canary is incremented with step weight 5 until complete 100 percent of traffic is routed to newer canary release.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9daf951348d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/deployment-on-gke-with-flagger-using-gcp-log-based-metrics-9daf951348d1">Deployment on GKE with Flagger using GCP Log Based Metrics</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>