<?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 Nathaniel (Nate) Avery on Medium]]></title>
        <description><![CDATA[Stories by Nathaniel (Nate) Avery on Medium]]></description>
        <link>https://medium.com/@nathaniel.avery?source=rss-86d7a10ff722------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Pi4-gRmSEzGXtTZD</url>
            <title>Stories by Nathaniel (Nate) Avery on Medium</title>
            <link>https://medium.com/@nathaniel.avery?source=rss-86d7a10ff722------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 23:57:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nathaniel.avery/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[Applying a Cloud Deploy Policy to an Existing Pipeline]]></title>
            <link>https://medium.com/google-cloud/applying-a-cloud-deploy-policy-to-an-existing-pipeline-fe39368e1605?source=rss-86d7a10ff722------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe39368e1605</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[gcp-security-operations]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Nathaniel (Nate) Avery]]></dc:creator>
            <pubDate>Wed, 11 Dec 2024 15:23:24 GMT</pubDate>
            <atom:updated>2024-12-17T00:40:49.762Z</atom:updated>
            <content:encoded><![CDATA[<p>Want to strengthen your deployment process with added security and control, without disrupting your existing setup? Cloud Deploy policies offer a straightforward way to enforce deployment rules across your environments, all without needing to modify your current configuration files. In this post, we’ll walk you through the simple steps of applying a policy to your pipeline, showing you how to gain greater control and peace of mind in your deployments.</p><p><a href="https://cloud.google.com/deploy/?e=48754805&amp;hl=en">Cloud Deploy</a> is a managed service offered by Google Cloud that orchestrates the delivery of applications to a series of target environments in a defined promotion sequence. A Cloud Deploy <strong>policy</strong> is a resource that lets you control and restrict actions in your deployment pipelines. You can use the policies feature to enforce specific deployment rules, enhance security, and manage risks in your continuous delivery process.</p><p>The cool thing is you can set up rules for your stuff without messing with the old setup files. You can do this right in the interface, or by making a special file and running it from the command line.</p><p>So, imagine this: My company has a rule for IT and developers — no software deployments during the US holidays (Nov 18 to Jan 7). Now, we can set up a Cloud Deploy policy to stop rollouts from happening during that time. It’s like a safety net for the holidays!</p><h3>Steps to Apply a Cloud Deploy Policy:</h3><ul><li><strong>Define Your Deploy Policy: </strong>Create a YAML file (e.g., deploypolicy.yaml) to configure your policy. This file will contain:</li><li>A <strong>header</strong> identifying the resource as a DeployPolicy and providing a unique name for the policy.</li><li><strong>Selectors</strong> specifying which pipelines or targets this policy will apply to. You can target specific pipelines or targets by their IDs or use labels for more flexible matching.</li><li><strong>Rules</strong> that outline the restrictions you want to enforce. For instance, you can define a rolloutRestriction rule to prevent deployments during specific time windows, such as weekends or holidays.</li></ul><p>You can specify the allowed actions, timeframes, and other conditions within these rules.</p><p>This deploypolicy.yaml file uses a single selector, the pipeline. The file applies only one rule. Walking through the rule, we can see that it’s set to create a rolloutRestriction named no-rollouts. There’s a timeWindow set based on America/New_York also known as the US East timezone. Last, we see the dates. Note the format is YYYY-MM-DD .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JA2Zaatku4uKWj5BC8ApYA.png" /></figure><ul><li><strong>Register Your Policy: </strong>Use the gcloud command-line tool to register your policy with the Cloud Deploy service</li></ul><p>The command has certain parameters to enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FmwRG3kkuQQ_35_XRJmxiw.png" /></figure><p>The command will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ay4RcGloSu0BFaWx1Lw-dw.png" /></figure><p>Replace REGION with the region where your Cloud Deploy resources are located and PROJECT_ID with your Google Cloud project ID.</p><p><strong>Verify the Policy:</strong></p><p>Go to the Cloud Deploy “Deploy Policies” page in the Google Cloud console to confirm your policy has been successfully created.</p><p>You can verify the policy applied by looking at the “Deploy polices” tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U0f5IXhNasNNl5dgt04jMw.png" /></figure><p>Now that the policy is applied, the CI/CD pipeline will not create a rollout thereby preventing a container reaching a target GKE Cluster or Cloud Run instance.</p><p>My test CI/CD pipeline is very simple consisting of Cloud Build, Artifact Registry, and Cloud Deploy. The code is in a GitHub repository. I have perviously validated that this pipeline deploys code as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fO_eUQ9RYS2te4pZPJ2Hew.png" /></figure><p>In this case, we’ll go to Cloud Build, select the appropriate Trigger, and push, “Run.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CT_qoxV9cH-U4OY-73Klgw.png" /></figure><p>Cloud Build automation drives the pipeline. Cloud Build builds a container, pushes it to the Artifact Registry, and tries to create a Rollout. But this time, we’ll hit a snag during Rollout creation and see an error in the Cloud Build logs.</p><p>The error reads “ERROR: (gcloud.deploy.releases.create) A create-rollout attempt was blocked by the “quickstart-deploy-policy” deploy policy.” The pipeline does not continue past this message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fqISFTNfr5sgupBejRiHUw.png" /></figure><p>In addition to Cloud Build Logs, you can find the policy enforcement message is in Logs Explorer.</p><p>In Cloud Deploy, go to the Pipeline, Expand pipeline details by selecting “SHOW MORE.” From there select “View”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*rArO4WZKKMgATv-JjQD-JA.png" /></figure><p>In Logs Explorer, the message can be found by filtering by Severity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hyZBmFfo9qhWaOt4WxJFJQ.png" /></figure><p>A look at the Cloud Deploy pipeline shows a blank where a rollout should be. This is an indication that the rollout never happened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zv4bVrd5jU0CHhBBJsluoQ.png" /></figure><p>Pub/Sub can also be used as a mechanism to notify platform admins and developers of the failure status.</p><p>By following these steps, you can effectively apply Cloud Deploy policies to your existing pipelines. This enables you to implement fine-grained control over your deployments, ensuring they adhere to organizational standards and security best practices.</p><p>This blog post focused on applying deployment restrictions. For more detailed examples and advanced configurations, refer to the Cloud Deploy documentation.</p><p>By integrating Cloud Deploy policies into your existing pipelines, you can significantly enhance the security and control of your deployments without major configuration changes. This approach allows you to enforce organizational policies, manage risks, and achieve greater peace of mind in your continuous delivery process. To delve deeper into the capabilities of Cloud Deploy, explore the comprehensive <a href="https://cloud.google.com/deploy/docs/deploy-policy">Cloud Deploy documentation</a> for detailed examples and advanced configurations. You can also find helpful guides, videos, and blog posts on the Google Cloud website. Start strengthening your deployments today by leveraging the power of Cloud Deploy policies.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe39368e1605" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/applying-a-cloud-deploy-policy-to-an-existing-pipeline-fe39368e1605">Applying a Cloud Deploy Policy to an Existing Pipeline</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[5 Helpful Commands for Cloud Workstations]]></title>
            <link>https://medium.com/google-cloud/5-helpful-commands-for-cloud-workstations-8b6e4856cb9c?source=rss-86d7a10ff722------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b6e4856cb9c</guid>
            <category><![CDATA[cloud-workstations]]></category>
            <category><![CDATA[gcp-app-dev]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[infrastructure]]></category>
            <dc:creator><![CDATA[Nathaniel (Nate) Avery]]></dc:creator>
            <pubDate>Thu, 15 Jun 2023 19:35:54 GMT</pubDate>
            <atom:updated>2023-06-20T16:37:05.661Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Cloud Workstations Logo" src="https://cdn-images-1.medium.com/max/193/1*2Kl1eybHdw4yn61jeuxTeA.png" /></figure><p>Google’s <a href="https://cloud.google.com/workstations">Cloud Workstations</a> is a powerful and flexible solutions for developers looking for a hosted IDE. Most users will work with it via the Google Cloud console. The console is well laid out and easy to get around, but some folks are more comfortable using a CLI. This could be for a number of reasons. Maybe it’s because they want to leverage automation, or maybe they find it faster to issue start/stop commands. Side note: Terraform is another automation option supported by Cloud Workstations. Whatever the reason, there are a few CLI commands that are worth knowing. There are also situations where Google Cloud console access may be discouraged by the organization.</p><p>I’ve written this blog post because I learn best when I see examples. If you’re like me, then maybe these will help.</p><p>These commands can be executed by anyone with the proper IAM permissions. The issuer will also need some knowledge of how Cloud Workstations has been configured for their organization. Some non-obvious things the issuer will need to know are:</p><ul><li>Cloud Workstations cluster name</li><li>Cloud Workstations configuration name</li><li>Cloud Workstations region</li></ul><p>Note: Please be sure to <a href="https://cloud.google.com/sdk/docs/install-sdk">install the latest version of the gcloud </a>CLI.</p><h3>Full List of Commands</h3><p>Before we begin, let’s look at the full list of commands.</p><pre><br>//==================[]==============================================\\<br>||     Command      ||                 Description                  ||<br>|]==================[]==============================================[|<br>|| create           || Create a workstation.                        ||<br>|| delete           || Delete a workstation                         ||<br>|| describe         || Describe a workstation                       ||<br>|| get-iam-policy   || Get the IAM policy for a workstation         ||<br>|| list             || List workstations                            ||<br>|| list-usable      || List usable workstations                     ||<br>|| set-iam-policy   || Set the IAM policy for a workstation         ||<br>|| ssh              || SSH into a running workstation               ||<br>|| start            || Start a workstation                          ||<br>|| start-tcp-tunnel || Start a tunnel through which a local process ||<br>|| _                || can forward TCP traffic to the workstation   ||<br>|| stop             || Stop a workstation                           ||<br>\\==================[]==============================================//<br></pre><h3>1. List Workstations available to you</h3><p>This command returns a list of all workstations the user has access to as defined in IAM permissions. There is a similar command, — list, which returns all workstations regardless of access permissions.</p><p><strong>Syntax:</strong></p><pre>gcloud beta workstations list-usable<br>    (--config=CONFIG : --cluster=CLUSTER --region=REGION)<br>    [--filter=EXPRESSION] [--limit=LIMIT] [--page-size=PAGE_SIZE]<br>    [--sort-by=[FIELD,...]] [GCLOUD_WIDE_FLAG ...]</pre><p><strong>Example:</strong></p><pre>gcloud beta workstations list-usable \<br> --config=basic-configuration-codeoss \<br> --cluster=cluster-us-east-4-va \<br> --region=us-east4</pre><h3>2. Start a Workstation</h3><p><strong>Syntax:</strong></p><pre>gcloud beta workstations start<br>    (WORKSTATION : --cluster=CLUSTER --config=CONFIG --region=REGION)<br>    [--async] [GCLOUD_WIDE_FLAG ...]</pre><p><strong>Example:</strong></p><pre>gcloud beta workstations start workstation-oss \<br>--cluster=cluster-us-east-4-va \<br>--config=basic-configuration-codeoss \<br>--region=us-east4 <br></pre><h3>3. Stop a Workstation</h3><p><strong>Syntax:</strong></p><pre>gcloud beta workstations stop<br>    (WORKSTATION : --cluster=CLUSTER --config=CONFIG --region=REGION)<br>    [--async] [GCLOUD_WIDE_FLAG ...]</pre><p><strong>Example:</strong></p><pre>gcloud beta workstations stop workstation-oss \<br>--cluster=cluster-us-east-4-va \<br>--config=basic-configuration-codeoss \<br>--region=us-east4 </pre><h3>4. Start a TCP Tunnel</h3><p><strong>Syntax:</strong></p><pre>gcloud beta workstations start-tcp-tunnel<br>    (WORKSTATION : --cluster=CLUSTER --config=CONFIG --region=REGION)<br>     WORKSTATION_PORT<br>     [--local-host-port=LOCAL_HOST_PORT; default=&quot;localhost:0&quot;]<br>     [GCLOUD_WIDE_FLAG ...]</pre><p><strong>Example:</strong></p><pre>gcloud beta workstations start-tcp-tunnel \<br>--project=riccardo-blog-test-v1 \<br>--cluster=cluster-us-east-4-va \<br>--config=basic-configuration-codeoss \<br>--region=us-east4 \<br>--local-host-port=:2222 \<br>workstation-oss 22</pre><h3>5. SSH into a Running Workstation</h3><p><strong>Syntax:</strong></p><pre>    gcloud beta workstations ssh<br>        (WORKSTATION : --cluster=CLUSTER --config=CONFIG --region=REGION)<br>        [--command=COMMAND] [--port=PORT; default=22]<br>        [--user=USER; default=&quot;user&quot;] [GCLOUD_WIDE_FLAG ...] [-- SSH_ARGS ...]</pre><p><strong>Example:</strong></p><pre>gcloud beta workstations ssh workstation-oss \<br>--cluster=cluster-us-east-4-va \<br>--config=basic-configuration-codeoss \<br>--region=us-east4</pre><h3>Conclusion</h3><p>Hopefully these syntax examples will aide anyone looking to use the CLI to control Cloud Workstations.</p><h3>References</h3><ul><li><a href="https://cloud.google.com/workstations/docs/overview">Cloud Workstations overview | Google Cloud</a></li><li><a href="https://cloud.google.com/workstations/docs/overview">Cloud Workstations overview | Google Cloud</a></li><li><a href="https://cloud.google.com/workstations/docs/overview">Cloud Workstations overview | Google Cloud</a></li><li><a href="https://www.youtube.com/live/gcYTVKua9ws?feature=share">How to accelerate developer velocity with Cloud Workstations</a></li><li><a href="https://blog.jetbrains.com/idea/2022/10/remote-development-in-jetbrains-ides-now-available-to-google-cloud-workstations-users/">Remote Development in JetBrains IDEs now available to Google Cloud Workstations users | The IntelliJ IDEA Blog</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FRklySZM7FFc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DRklySZM7FFc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FRklySZM7FFc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/70234802c2a58c957ddd90260318d133/href">https://medium.com/media/70234802c2a58c957ddd90260318d133/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FlhuLuIiEirM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DlhuLuIiEirM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FlhuLuIiEirM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/19cb24c75575d7d77852961d98b920c1/href">https://medium.com/media/19cb24c75575d7d77852961d98b920c1/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b6e4856cb9c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/5-helpful-commands-for-cloud-workstations-8b6e4856cb9c">5 Helpful Commands for Cloud Workstations</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>