diff --git a/examples/v1/kubernetes/bluegreen/app.pipecd.yaml b/examples/v1/kubernetes/bluegreen/app.pipecd.yaml new file mode 100644 index 0000000000..f56f159c0b --- /dev/null +++ b/examples/v1/kubernetes/bluegreen/app.pipecd.yaml @@ -0,0 +1,41 @@ +apiVersion: pipecd.dev/v1beta1 +kind: Application +spec: + name: bluegreen + labels: + env: example + team: product + pipeline: + stages: + # Roll out CANARY variant with the same number of replicas as PRIMARY. + - name: K8S_CANARY_ROLLOUT + with: + replicas: 100% + # Route all traffic to CANARY variant. + - name: K8S_TRAFFIC_ROUTING + with: + canary: 100 + # Wait for a manual approval on the web console before promoting. + - name: WAIT_APPROVAL + with: + minApproverNum: 1 + # Replace with real usernames. + approvers: + - example-user + # Roll out PRIMARY variant to the new version. + - name: K8S_PRIMARY_ROLLOUT + # Route all traffic back to PRIMARY variant. + - name: K8S_TRAFFIC_ROUTING + with: + primary: 100 + # Clean up CANARY variant workloads. + - name: K8S_CANARY_CLEAN + plugins: + kubernetes: + input: + manifests: + - deployment.yaml + - service.yaml + description: | + This app demonstrates how to deploy a Kubernetes app by BlueGreen strategy without requiring any mesh. + References: [adding a new app](https://pipecd.dev/docs-v1.0.x/user-guide/managing-application/adding-an-application/), [app configuration](https://pipecd.dev/docs-v1.0.x/user-guide/managing-application/configuration-reference/) diff --git a/examples/v1/kubernetes/bluegreen/deployment.yaml b/examples/v1/kubernetes/bluegreen/deployment.yaml new file mode 100644 index 0000000000..99832b1f15 --- /dev/null +++ b/examples/v1/kubernetes/bluegreen/deployment.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: bluegreen + labels: + app: bluegreen +spec: + replicas: 2 + selector: + matchLabels: + app: bluegreen + pipecd.dev/variant: primary + template: + metadata: + labels: + app: bluegreen + pipecd.dev/variant: primary + spec: + containers: + - name: helloworld + image: ghcr.io/pipe-cd/helloworld:v0.32.0 + args: + - server + ports: + - containerPort: 9085 diff --git a/examples/v1/kubernetes/bluegreen/service.yaml b/examples/v1/kubernetes/bluegreen/service.yaml new file mode 100644 index 0000000000..a88f25246f --- /dev/null +++ b/examples/v1/kubernetes/bluegreen/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: bluegreen +spec: + selector: + app: bluegreen + pipecd.dev/variant: primary + ports: + - protocol: TCP + port: 9085 + targetPort: 9085