Beginner Workshop

During this workshop, we will create a production ready canary deployment, without the use of Ocean CD verification providers and templates. If you want to utilize them, skip ahead to the advanced workshop.

Ocean CD Entities

For this next section, we will modify our end-to-end YAML to make sure our Ocean CD entities tie into the k8s resources we created in the last section.

Let’s start by creating a local file on your machine and name it oceancd-entity.yaml


kind: Strategy
name: "oceancd-workshop"
canary: 
  steps: 
    - name: "My-first-phase"
      setWeight: 20
      pause: 
        duration: 1m
    - name: "second-phase"
      setWeight: 40
    - name: "third-phase"
      setWeight: 80
      pause: 
        duration: 1m


---

kind: RolloutSpec
name: "OceanCD-Rolloutspec-1"
spotDeployment: 
  clusterId: "oceancd-demo"
  namespace: "oceancd-workshop"
  name: "nginx-deployment"
strategy: 
  name: "oceancd-workshop"
traffic: 
  canaryService: "rollouts-demo-canary"
  stableService: "rollouts-demo-stable"
failurePolicy: 
  action: abort

Before applying this yaml file to the cluster, we need to verify one item:

ClusterIds- This is referenced for both Verification Provider and Rollout Spec. If the name of the cluster you created is not “oceancd-demo”, then you will need to update this.

Run the command:

oceancd apply -f oceancd-entity.yaml

Now that we have created all of the k8s resources and Ocean CD entities, let’s test it! Go back to your first YAML file that was created and update the image version to the following:

image: public.ecr.aws/nginx/nginx:1.23

Now save that file and apply.

kubectl apply -f k8s-e2e.yaml

This will trigger your first rollout. You should now see all the pieces coming together:

  • Production Ready Canary Deployment
  • Verification Driven Rollouts- Tied into your actual promethus metrics
  • Spot Deployment
  • Automated Rollbacks in the event you encounter a failure

workloads

At this point, we encourage you to continue making changes to your Ocean CD entities and continue testing the capabilities of Ocean CD. Some fun capabilities include:

  • Change Strategy - Include manual approval processes at different phases
  • Create another Spot Deployment - Reuse the same strategy
  • Make a change that will intentionally fail your rollout and see the automated rollback in action

Windows Users

At this time, the Ocean CD CLI is only supported on MAC and Linux operating systems. If you are a Windows users, we have provided these same templates in JSON format and you can easily run them in Postman by following the link below:

Run in Postman