Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeploymentConfig migration to Deployment #69

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
*_DeploymentConfig.json
*_Deployment.json
*_BuildConfig.json
*.crt
*.key
Expand All @@ -12,4 +13,4 @@
# Visual Studio Code
.vscode
.idea/*
.vs
.vs
6 changes: 3 additions & 3 deletions openshift/manage
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ function cleanResources() {

function getSetting() {
namespace=${1}
dcName=${2}
dName=${2}
settingName=${3}
deploymentConfig=$(oc -n ${namespace} get dc ${dcName} -o json)
setting=$(${JQ_EXE} -nr "${deploymentConfig} | .spec.template.spec.containers[].env[] | select(.name==\"${settingName}\") | .value")
deployment=$(oc -n ${namespace} get deployment ${dName} -o json)
setting=$(${JQ_EXE} -nr "${deployment} | .spec.template.spec.containers[].env[] | select(.name==\"${settingName}\") | .value")
echo "${setting}"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ objects:
webhook-url: ${CONTROLLER_WEBHOOK_URL}
type: Opaque

- kind: DeploymentConfig
apiVersion: v1
- kind: Deployment
apiVersion: apps/v1
metadata:
name: ${NAME}${SUFFIX}
labels:
Expand All @@ -125,17 +125,13 @@ objects:
app-group: ${APP_GROUP}
role: ${ROLE}
env: ${TAG_NAME}
annotations:
description: Defines how to deploy the application server
app.openshift.io/connects-to: >-
[{"apiVersion":"apps.openshift.io/v1","kind":"DeploymentConfig","name":"${WALLET_HOST}${SUFFIX}"},
{"apiVersion":"apps.openshift.io/v1","kind":"DeploymentConfig","name":"${ENDORSER_SERVICE_HOST}${SUFFIX}"}]
spec:
replicas: 1
selector:
name: ${NAME}${SUFFIX}
matchLabels:
name: ${NAME}${SUFFIX}
strategy:
type: Rolling
type: RollingUpdate
template:
metadata:
name: ${NAME}${SUFFIX}
Expand Down Expand Up @@ -260,7 +256,7 @@ objects:
value: ${ENDORSER_SERVICE_PORT}
- name: ENDORSER_SERVICE_HOST
value: ${ENDORSER_SERVICE_HOST}${SUFFIX}
image:
image: image-registry.openshift-image-registry.svc:5000/${IMAGE_NAMESPACE}/${NAME}:${TAG_NAME}
ports:
- containerPort: ${{AGENT_ADMIN_PORT}}
protocol: TCP
Expand Down Expand Up @@ -295,17 +291,6 @@ objects:
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- ${NAME}${SUFFIX}
from:
kind: ImageStreamTag
name: ${NAME}:${TAG_NAME}
namespace: ${IMAGE_NAMESPACE}

- kind: HorizontalPodAutoscaler
apiVersion: autoscaling/v2
Expand All @@ -320,8 +305,8 @@ objects:
env: ${TAG_NAME}
spec:
scaleTargetRef:
apiVersion: apps.openshift.io/v2
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
name: ${NAME}${SUFFIX}
minReplicas: ${{MIN_REPLICAS}}
maxReplicas: ${{MAX_REPLICAS}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ objects:
webhook-api-key: ${ACAPY_WEBHOOK_URL_API_KEY}
type: Opaque

- kind: DeploymentConfig
apiVersion: v1
- kind: Deployment
apiVersion: apps/v1
metadata:
name: ${NAME}${SUFFIX}
labels:
Expand All @@ -95,17 +95,13 @@ objects:
app-group: ${APP_GROUP}
role: ${ROLE}
env: ${TAG_NAME}
annotations:
description: Defines how to deploy the application server
app.openshift.io/connects-to: >-
[{"apiVersion":"apps.openshift.io/v1","kind":"DeploymentConfig","name":"${ACAPY_ADMIN_HOST}${SUFFIX}"},
{"apiVersion":"apps.openshift.io/v1","kind":"DeploymentConfig","name":"${CONTROLLER_POSTGRESQL_HOST}${SUFFIX}"}]
spec:
replicas: 1
selector:
name: ${NAME}${SUFFIX}
matchLabels:
name: ${NAME}${SUFFIX}
strategy:
type: Rolling
type: RollingUpdate
template:
metadata:
name: ${NAME}${SUFFIX}
Expand Down Expand Up @@ -195,7 +191,7 @@ objects:

- name: LOG_LEVEL
value: ${LOG_LEVEL}
image: " "
image: image-registry.openshift-image-registry.svc:5000/${IMAGE_NAMESPACE}/${NAME}:${TAG_NAME}
ports:
- containerPort: ${{ENDORSER_SERVICE_PORT}}
protocol: TCP
Expand Down Expand Up @@ -226,17 +222,6 @@ objects:
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- ${NAME}${SUFFIX}
from:
kind: ImageStreamTag
name: ${NAME}:${TAG_NAME}
namespace: ${IMAGE_NAMESPACE}

- kind: HorizontalPodAutoscaler
apiVersion: autoscaling/v2
Expand All @@ -251,8 +236,8 @@ objects:
env: ${TAG_NAME}
spec:
scaleTargetRef:
apiVersion: apps.openshift.io/v2
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
name: ${NAME}${SUFFIX}
minReplicas: ${{MIN_REPLICAS}}
maxReplicas: ${{MAX_REPLICAS}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CONFIG_MAP_NAME=${NAME}-${CONFIG_MAP_NAME:-backup-conf}
SOURCE_FILE=$( dirname "$0" )/config/backup.conf

OUTPUT_FORMAT=json
OUTPUT_FILE=${CONFIG_MAP_NAME}-configmap_DeploymentConfig.json
OUTPUT_FILE=${CONFIG_MAP_NAME}-configmap_Deployment.json

printStatusMsg "Generating ConfigMap; ${CONFIG_MAP_NAME} ..."
generateConfigMap "${CONFIG_MAP_NAME}" "${SOURCE_FILE}" "${OUTPUT_FORMAT}" "${OUTPUT_FILE}"
Expand All @@ -30,4 +30,4 @@ else
fi

SPECIALDEPLOYPARMS="--param-file=${_overrideParamFile}"
echo ${SPECIALDEPLOYPARMS}
echo ${SPECIALDEPLOYPARMS}
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ objects:
stringData:
webhook-url: ${WEBHOOK_URL}
type: Opaque
- kind: DeploymentConfig
apiVersion: v1
- kind: Deployment
apiVersion: apps/v1
metadata:
name: ${NAME}${SUFFIX}
labels:
Expand All @@ -64,28 +64,13 @@ objects:
app-group: ${APP_GROUP}
role: ${ROLE}
env: ${TAG_NAME}
annotations:
description: Defines how to deploy the application server
app.openshift.io/connects-to: >-
[{"apiVersion":"apps.openshift.io/v1","kind":"DeploymentConfig","name":"${ARIES_ENDORSER_DB_HOST}${SUFFIX}"},
{"apiVersion":"apps.openshift.io/v1","kind":"DeploymentConfig","name":"${ARIES_ENDORSER_WALLET_HOST}${SUFFIX}"}]
spec:
strategy:
type: Recreate
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- ${NAME}${SUFFIX}
from:
kind: ImageStreamTag
namespace: ${IMAGE_NAMESPACE}
name: ${SOURCE_IMAGE_NAME}:${TAG_NAME}
replicas: 1
selector:
name: ${NAME}${SUFFIX}
matchLabels:
name: ${NAME}${SUFFIX}
template:
metadata:
name: ${NAME}${SUFFIX}
Expand All @@ -112,7 +97,7 @@ objects:
path: ${CONFIG_FILE_NAME}
containers:
- name: ${NAME}${SUFFIX}
image: ""
image: image-registry.openshift-image-registry.svc:5000/${IMAGE_NAMESPACE}/${NAME}:${TAG_NAME}
ports: []
env:
- name: BACKUP_STRATEGY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ objects:
role: ${ROLE}
app: ${APP_NAME}${SUFFIX}
env: ${TAG_NAME}
- kind: DeploymentConfig
apiVersion: v1
- kind: Deployment
apiVersion: apps/v1
metadata:
name: ${NAME}${SUFFIX}
generation: 1
Expand All @@ -65,25 +65,11 @@ objects:
spec:
strategy:
type: Recreate
recreateParams:
timeoutSeconds: 600
resources: {}
activeDeadlineSeconds: 21600
triggers:
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- ${NAME}${SUFFIX}
from:
kind: ImageStreamTag
namespace: ${IMAGE_NAMESPACE}
name: ${SOURCE_IMAGE_NAME}:${TAG_NAME}
- type: ConfigChange
replicas: 1
test: false
selector:
name: ${NAME}${SUFFIX}
matchLabels:
name: ${NAME}${SUFFIX}
template:
metadata:
labels:
Expand All @@ -101,7 +87,7 @@ objects:
claimName: ${NAME}${SUFFIX}
containers:
- name: ${NAME}${SUFFIX}
image: ' '
image: image-registry.openshift-image-registry.svc:5000/${IMAGE_NAMESPACE}/${NAME}:${TAG_NAME}
ports:
- containerPort: 5432
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ fi
CONFIG_MAP_NAME=${NAME}-${CADDY_CONFIG_MAP_NAME:-caddy-conf}
SOURCE_FILE=$( dirname "$0" )/config/Caddyfile
OUTPUT_FORMAT=json
OUTPUT_FILE=${CONFIG_MAP_NAME}-configmap_DeploymentConfig.json
OUTPUT_FILE=${CONFIG_MAP_NAME}-configmap_Deployment.json

printStatusMsg "Generating ConfigMap; ${CONFIG_MAP_NAME} ..."
generateConfigMap "${CONFIG_MAP_NAME}${SUFFIX}" "${SOURCE_FILE}" "${OUTPUT_FORMAT}" "${OUTPUT_FILE}"

unset SPECIALDEPLOYPARMS
echo ${SPECIALDEPLOYPARMS}
echo ${SPECIALDEPLOYPARMS}
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ objects:
selector:
name: ${NAME}${SUFFIX}

- kind: DeploymentConfig
apiVersion: v1
- kind: Deployment
apiVersion: apps/v1
metadata:
name: ${NAME}${SUFFIX}
labels:
Expand All @@ -147,28 +147,13 @@ objects:
app-group: ${APP_GROUP}
role: ${ROLE}
env: ${TAG_NAME}
annotations:
description: Defines how to deploy the application server
app.openshift.io/connects-to: >-
[{"apiVersion":"apps.openshift.io/v1","kind":"DeploymentConfig","name":"${ACAPY_AGENT_HOST}${SUFFIX}"},
{"apiVersion":"apps.openshift.io/v1","kind":"DeploymentConfig","name":"${ENDORSER_SERVICE_HOST}${SUFFIX}"}]
spec:
strategy:
type: Rolling
triggers:
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- ${NAME}${SUFFIX}
from:
kind: ImageStreamTag
namespace: ${IMAGE_NAMESPACE}
name: ${NAME}:${TAG_NAME}
- type: ConfigChange
type: RollingUpdate
replicas: 1
selector:
name: ${NAME}${SUFFIX}
matchLabels:
name: ${NAME}${SUFFIX}
template:
metadata:
name: ${NAME}${SUFFIX}
Expand All @@ -188,7 +173,7 @@ objects:
path: ${CADDY_CONFIG_FILE_NAME}
containers:
- name: ${NAME}${SUFFIX}
image: " "
image: image-registry.openshift-image-registry.svc:5000/${IMAGE_NAMESPACE}/${NAME}:${TAG_NAME}
ports:
- containerPort: ${{CADDY_AGENT_ADMIN_PORT}}
protocol: TCP
Expand Down Expand Up @@ -258,8 +243,8 @@ objects:
env: ${TAG_NAME}
spec:
scaleTargetRef:
apiVersion: apps.openshift.io/v2
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
name: ${NAME}${SUFFIX}
minReplicas: ${{MIN_REPLICAS}}
maxReplicas: ${{MAX_REPLICAS}}
Expand Down Expand Up @@ -438,4 +423,4 @@ parameters:
displayName: Resources Memory Limit
description: The resources Memory limit (in Mi, Gi, etc) for this build.
required: true
value: 128Mi
value: 128Mi
Loading