PipeCD v0.44.0 was released🎉
Tags: pipecd, cicd, gitops
Published: 2023-06-27 00:17:26

## tl;dr
PipeCD v0.44.0, the latest version of PipeCD, was released on June 24, 2023. This article highlights the New Features and Notable Changes from the Release Notes.

## New Features
### Custom Sync Stage
[Custom Sync](https://pipecd.dev/docs/user-guide/managing-application/customizing-deployment/custom-sync/) allows executing arbitrary shell commands as a step in the deployment process. This feature is currently in alpha and only available for AWS Lambda.

To deploy Lambda using the SAM (Serverless Application Model) command, you can configure the pipeline as follows:

```yaml
apiVersion: pipecd.dev/v1beta1
kind: LambdaApp
spec:
  name: sam-simple
  labels:
    env: example
    team: abc
  planner:
    # Must add this configuration to force use CUSTOM_SYNC stage.
    alwaysUsePipeline: true
  pipeline:
    stages:
      - name: CUSTOM_SYNC
        with:
          envs:
            AWS_PROFILE: "sample"
          run: |
            cd sam-app
            sam build
            echo y | sam deploy --profile $AWS_PROFILE  
```

Please note that the commands executed in Custom Sync assume that they are already available in the execution environment of piped. Therefore, users need to create custom images instead of using the officially provided piped. Discussions are currently underway [here](https://github.com/pipe-cd/pipecd/discussions/4380) on how to provide custom images while minimizing the user's burden. Your input is welcome if you are interested.

### Manifest Attachment
[Manifest Attachment](https://pipecd.dev/docs/user-guide/managing-application/manifest-attachment/) enables using functionalities similar to Kubernetes ConfigMap in non-Kubernetes applications.

Let's take ECS as an example. Create a `config.yaml` as follows:
```yaml
mysql:
  rootPassword: "test"
  database: "pipecd"
```

In the `app.pipecd.yaml` file, configure it like this:
```yaml
apiVersion: pipecd.dev/v1beta1
kind: ECSApp
spec:
  name: secret-management
    ...
  attachment:
    sources:
      config: config.yaml
    targets:
      - taskdef.yaml
```

To reference the content of `config.yaml` in `taskdef.yaml`, use the following method:
```yaml
...
containerDefinitions:
  - command: "echo {{ .attachment.config }}"
    image: nginx:1
    cpu: 100
    memory: 100
    name: web
...
```

While this feature can be used independently, it can be more securely utilized when combined with [Secret Management](https://pipecd.dev/docs/user-guide/managing-application/secret-management/).

### Terraform v1.5.0 Import Block Support
Support for the [import block](https://www.hashicorp.com/blog/terraform-1-5-brings-config-driven-import-and-checks) introduced in Terraform v1.5.0 is now available. When using Terraform v1.5.0 or later versions, the `import` operation will be displayed in addition to `add`, `change`, and `destroy`.

### Deployment Metrics
Prometheus metrics for each deployment have been added, allowing detailed information about deployments to be retrieved. Examples of metrics

```
// Number of currently RUNNING deployments
count(count by (deployment) (deployment_status{status="DEPLOYMENT_RUNNING"}))

// Detect if there are any deployments in RUNNING status for over 1 hour
sum_over_time(deployment_status{status="DEPLOYMENT_RUNNING"}[1h:1m]) >= 60 and deployment_status{status="DEPLOYMENT_RUNNING"} == 1

// Number of completed deployments in the last 24 hours
sum(floor(increase(deployment_status{pipecd_component=\"piped\",status=~\"DEPLOYMENT_CANCELLED|DEPLOYMENT_SUCCESS|DEPLOYMENT_FAILURE\"}[24h])))
```

These metrics are collected by piped and can be obtained from the piped's [admin server](https://pipecd.dev/docs-dev/user-guide/managing-controlplane/metrics/). Therefore, teams using piped can now set up alerts for scenarios such as detecting deployments that do not finish for a long time.

### kubectl Server-Side Apply Support
Support for [Server-Side Apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/), which became GA in Kubernetes v1.22, has been added. By adding the `pipecd.dev/sync-by-replace` annotation to a k8s workload, piped will add the `--server-side` flag to `kubectl apply`.

## Notable Changes
### Display of Platform Provider in Deployment Details Page
The Deployment details page now displays the Platform provider.
![Platform provider in Deployment details](https://storage.googleapis.com/zenn-user-upload/f2b4f77ee525-20230627.png)

### Slack API Support
Slack integration now supports Slack API in addition to webhooks.

### Lambda Architecture Support
AWS Lambda [architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html) can now be specified.

### Support for Log Level Configuration
Log levels can now be configured for both pipecd and piped:
- [pipecd](https://github.com/pipe-cd/pipecd/blob/743b8aa2e4ca12cf310c06d3476c0f43923b0e42/manifests/pipecd/values.yaml#L41)
- [piped](https://github.com/pipe-cd/pipecd/blob/743b8aa2e4ca12cf310c06d3476c0f43923b0e42/manifests/piped/values.yaml#L11)

### ECS EnableExecuteCommand Support
Support for ECS `enableExecuteCommand` has been added.