Container Migration Guide

Container support has changed drastically in FlexDeploy 6.0.0.0. This guide will walk you through any changes you need to make to migrate your existing projects and workflows to the new version.

If you wish to reference your previous container configuration, it will be located inside of the <FlexDeployApplicationDirectory>/migration/8.0/container directory.

Migrating old project based operations

The following operations have been removed, and they will need to be migrated to the operations which do not read from the project configuration.

  • dockerBuildProjectImage → dockerBuild

  • dockerDeployProjectContainer → dockerRunContainer

  • Kubernetes deploy → apply

Using new FD_BUILT_DOCKER values instead of FD_PROJECT values

If you were previously using FD_PROJECT_DOCKER_IMAGE_NAME in a Kubernetes manifest or helm value you will need to use one or more of the following variables instead:

  • FD_BUILT_DOCKER_IMAGE – The built Docker image, including repository and tag

  • FD_BUILT_DOCKER_IMAGE_NAME – The built Docker image name (No tag)

  • FD_BUILT_DOCKER_IMAGE_TAG – The built Docker tag

  • FD_BUILT_DOCKER_LINK – The link to the built Docker image when pushed to a repository

  • FD_BUILT_DOCKER_IMAGE_ID –  The id of the created image

For example if you had the following manifest previously

apiVersion: apps/v1 kind: Deployment metadata: name: natours spec: replicas: 2 selector: matchLabels: app.kubernetes.io/name: natours app.kubernetes.io/instance: natours template: metadata: labels: app.kubernetes.io/name: natours app.kubernetes.io/instance: natours spec: containers: - name: natours image: "${{FD_PROJECT_DOCKER_IMAGE_NAME}}" imagePullPolicy: IfNotPresent ports: - name: http containerPort: 8099 protocol: TCP livenessProbe: httpGet: path: / port: http readinessProbe: httpGet: path: / port: http

It would now look like this:

apiVersion: apps/v1 kind: Deployment metadata: name: natours spec: replicas: 2 selector: matchLabels: app.kubernetes.io/name: natours app.kubernetes.io/instance: natours template: metadata: labels: app.kubernetes.io/name: natours app.kubernetes.io/instance: natours spec: containers: - name: natours image: "${{FD_BUILT_DOCKER_IMAGE}}" imagePullPolicy: IfNotPresent ports: - name: http containerPort: 8099 protocol: TCP livenessProbe: httpGet: path: / port: http readinessProbe: httpGet: path: / port: http

The Kubernetes apply operation now supports property replacement inside of it’s manifest text input. This means you can use these values there as well.

Setting properties

Now that your workflows are all set, head over to your project. You will need to set the 2 project properties FDDKR_IMAGE_NAME and FDDKR_IMAGE_TAG. These will decide the image name and tag used when building an image.

Additionally several new variables have been made available for use in project properties to ease this transition. The following variables were added to properties:

  • FD_PROJECT_VERSION – Version of the project, as seen on the project execution screen

  • FDBLD_BRANCH_NAME – Name of the branch as configured in the source control section

  • FDBLD_BRANCH_ATTRIBUTE1 (and 2 and 3) – Branch attributes as configured in the source control section

These new variables allow for many scenarios that were previously possible, including having different tags for every branch. For example something like this:

FDBLD_BRANCH_NAME + "-" + FD_PROJECT_VERSION

Docker scanning and Kubernetes monitoring

Automatic Docker scanning and Kubernetes monitoring have been removed. Docker scanning can still be achieved using the Anchore plugin.

Deployment Strategies

Deployment strategies for kubernetes/helm have also been removed.

The following macros are not currently supported in the footer:
  • style