Skip to content

Instantly share code, notes, and snippets.

@bmaupin
Last active July 15, 2024 17:12
Show Gist options
  • Save bmaupin/d5be3ca882345ff92e8336698230dae0 to your computer and use it in GitHub Desktop.
Save bmaupin/d5be3ca882345ff92e8336698230dae0 to your computer and use it in GitHub Desktop.
Convert OpenShift DeploymentConfig to Kubernetes Deployment
  1. Change apiVersion from:

    - apiVersion: v1

    (or apiVersion: apps.openshift.io/v1)

    to:

    - apiVersion: apps/v1
  2. Change kind from:

      kind: DeploymentConfig

    to:

      kind: Deployment
  3. Change spec.selectors from:

        selector:
          name: ...

    to:

        selector:
          matchLabels:
            name: ...
  4. Make sure spec.template.spec.containers.image is set, e.g.

            image: registry.access.redhat.com/rhscl/postgresql-${POSTGRESQL_VERSION}-rhel7
            imagePullPolicy: Always
    
  5. Remove spec.triggers section entirely

@lsloan
Copy link

lsloan commented Jul 15, 2024

Similar to what @kvaps wrote, I thought the DeploymentConfig to Deployment conversion could be done with yq, if working with YAML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment