diff --git a/examples/v1/deployment-chain/first/app.pipecd.yaml b/examples/v1/deployment-chain/first/app.pipecd.yaml new file mode 100644 index 0000000000..c070d51d46 --- /dev/null +++ b/examples/v1/deployment-chain/first/app.pipecd.yaml @@ -0,0 +1,20 @@ +apiVersion: pipecd.dev/v1beta1 +kind: Application +spec: + name: deployment-chain-first + labels: + env: example + team: product + plugins: + # No input block: deployment.yaml + service.yaml are auto-discovered. + kubernetes: {} + postSync: + # Once this app finishes deploying, PipeCD triggers the next app in the + # chain (matched by application name). That app can then trigger the one + # after it, forming a sequence. + chain: + applications: + - name: deployment-chain-second + description: | + This app is the first link in a deployment chain. When it deploys successfully, PipeCD triggers deployment-chain-second, which in turn triggers deployment-chain-third - one commit rolls out three apps in order.\ + 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/deployment-chain/first/deployment.yaml b/examples/v1/deployment-chain/first/deployment.yaml new file mode 100644 index 0000000000..73070fb4fe --- /dev/null +++ b/examples/v1/deployment-chain/first/deployment.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dchain-first + labels: + app: dchain-first +spec: + replicas: 1 + selector: + matchLabels: + app: dchain-first + pipecd.dev/variant: primary + template: + metadata: + labels: + app: dchain-first + pipecd.dev/variant: primary + annotations: + sidecar.istio.io/inject: "false" + spec: + containers: + - name: helloworld + image: ghcr.io/pipe-cd/helloworld:v0.32.0 + args: + - server + ports: + - containerPort: 9085 diff --git a/examples/v1/deployment-chain/first/service.yaml b/examples/v1/deployment-chain/first/service.yaml new file mode 100644 index 0000000000..66c25f320b --- /dev/null +++ b/examples/v1/deployment-chain/first/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: dchain-first +spec: + selector: + app: dchain-first + ports: + - protocol: TCP + port: 9085 + targetPort: 9085 diff --git a/examples/v1/deployment-chain/second/app.pipecd.yaml b/examples/v1/deployment-chain/second/app.pipecd.yaml new file mode 100644 index 0000000000..3170b34a07 --- /dev/null +++ b/examples/v1/deployment-chain/second/app.pipecd.yaml @@ -0,0 +1,21 @@ +apiVersion: pipecd.dev/v1beta1 +kind: Application +spec: + name: deployment-chain-second + labels: + env: example + team: product + trigger: + # Allow this app to be triggered as part of a chain. onChain defaults to + # disabled, so downstream apps must opt in. + onChain: + disabled: false + plugins: + kubernetes: {} + postSync: + chain: + applications: + - name: deployment-chain-third + description: | + Second link in the deployment chain: triggered by deployment-chain-first, and once it succeeds it triggers deployment-chain-third.\ + 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/deployment-chain/second/deployment.yaml b/examples/v1/deployment-chain/second/deployment.yaml new file mode 100644 index 0000000000..c1ad039d31 --- /dev/null +++ b/examples/v1/deployment-chain/second/deployment.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dchain-second + labels: + app: dchain-second +spec: + replicas: 1 + selector: + matchLabels: + app: dchain-second + pipecd.dev/variant: primary + template: + metadata: + labels: + app: dchain-second + pipecd.dev/variant: primary + annotations: + sidecar.istio.io/inject: "false" + spec: + containers: + - name: helloworld + image: ghcr.io/pipe-cd/helloworld:v0.32.0 + args: + - server + ports: + - containerPort: 9085 diff --git a/examples/v1/deployment-chain/second/service.yaml b/examples/v1/deployment-chain/second/service.yaml new file mode 100644 index 0000000000..6839686bef --- /dev/null +++ b/examples/v1/deployment-chain/second/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: dchain-second +spec: + selector: + app: dchain-second + ports: + - protocol: TCP + port: 9085 + targetPort: 9085 diff --git a/examples/v1/deployment-chain/third/app.pipecd.yaml b/examples/v1/deployment-chain/third/app.pipecd.yaml new file mode 100644 index 0000000000..13f8fc3bd7 --- /dev/null +++ b/examples/v1/deployment-chain/third/app.pipecd.yaml @@ -0,0 +1,15 @@ +apiVersion: pipecd.dev/v1beta1 +kind: Application +spec: + name: deployment-chain-third + labels: + env: example + team: product + trigger: + onChain: + disabled: false + plugins: + kubernetes: {} + description: | + Final link in the deployment chain: triggered by deployment-chain-second. It has no postSync chain, so the sequence ends here.\ + 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/deployment-chain/third/deployment.yaml b/examples/v1/deployment-chain/third/deployment.yaml new file mode 100644 index 0000000000..64f83e074c --- /dev/null +++ b/examples/v1/deployment-chain/third/deployment.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dchain-third + labels: + app: dchain-third +spec: + replicas: 1 + selector: + matchLabels: + app: dchain-third + pipecd.dev/variant: primary + template: + metadata: + labels: + app: dchain-third + pipecd.dev/variant: primary + annotations: + sidecar.istio.io/inject: "false" + spec: + containers: + - name: helloworld + image: ghcr.io/pipe-cd/helloworld:v0.32.0 + args: + - server + ports: + - containerPort: 9085 diff --git a/examples/v1/deployment-chain/third/service.yaml b/examples/v1/deployment-chain/third/service.yaml new file mode 100644 index 0000000000..5fcdf3acdf --- /dev/null +++ b/examples/v1/deployment-chain/third/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: dchain-third +spec: + selector: + app: dchain-third + ports: + - protocol: TCP + port: 9085 + targetPort: 9085