diff --git a/.gitignore b/.gitignore index 6d198617..fde1bf29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # See http://help.github.com/ignore-files/ for more about ignoring files. *_DeploymentConfig.json +*_Deployment.json *_BuildConfig.json *.crt *.key @@ -12,4 +13,4 @@ # Visual Studio Code .vscode .idea/* -.vs \ No newline at end of file +.vs diff --git a/openshift/manage b/openshift/manage index 0360ed9e..f06cb205 100644 --- a/openshift/manage +++ b/openshift/manage @@ -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}" } diff --git a/openshift/templates/aries-endorser-agent/aries-endorser-agent-deploy.yaml b/openshift/templates/aries-endorser-agent/aries-endorser-agent-deploy.yaml index 76189150..9647330d 100755 --- a/openshift/templates/aries-endorser-agent/aries-endorser-agent-deploy.yaml +++ b/openshift/templates/aries-endorser-agent/aries-endorser-agent-deploy.yaml @@ -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: @@ -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} @@ -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 @@ -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 @@ -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}} diff --git a/openshift/templates/aries-endorser-api/aries-endorser-api-deploy.yaml b/openshift/templates/aries-endorser-api/aries-endorser-api-deploy.yaml index 536cd3cb..6d6c7821 100755 --- a/openshift/templates/aries-endorser-api/aries-endorser-api-deploy.yaml +++ b/openshift/templates/aries-endorser-api/aries-endorser-api-deploy.yaml @@ -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: @@ -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} @@ -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 @@ -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 @@ -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}} diff --git a/openshift/templates/aries-endorser-db/aries-endorser-db-deploy.yaml b/openshift/templates/aries-endorser-db/aries-endorser-db-deploy.yaml index 1331cb9a..c76a266e 100644 --- a/openshift/templates/aries-endorser-db/aries-endorser-db-deploy.yaml +++ b/openshift/templates/aries-endorser-db/aries-endorser-db-deploy.yaml @@ -39,8 +39,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 @@ -55,25 +55,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: @@ -91,7 +77,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 diff --git a/openshift/templates/aries-endorser-proxy/aries-endorser-proxy-deploy.overrides.sh b/openshift/templates/aries-endorser-proxy/aries-endorser-proxy-deploy.overrides.sh index 585c3fcb..e6418cd3 100755 --- a/openshift/templates/aries-endorser-proxy/aries-endorser-proxy-deploy.overrides.sh +++ b/openshift/templates/aries-endorser-proxy/aries-endorser-proxy-deploy.overrides.sh @@ -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} \ No newline at end of file +echo ${SPECIALDEPLOYPARMS} diff --git a/openshift/templates/aries-endorser-proxy/aries-endorser-proxy-deploy.yaml b/openshift/templates/aries-endorser-proxy/aries-endorser-proxy-deploy.yaml index 46036446..2015605e 100644 --- a/openshift/templates/aries-endorser-proxy/aries-endorser-proxy-deploy.yaml +++ b/openshift/templates/aries-endorser-proxy/aries-endorser-proxy-deploy.yaml @@ -136,8 +136,8 @@ objects: selector: name: ${NAME}${SUFFIX} - - kind: DeploymentConfig - apiVersion: v1 + - kind: Deployment + apiVersion: apps/v1 metadata: name: ${NAME}${SUFFIX} labels: @@ -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} @@ -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 @@ -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}} @@ -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 \ No newline at end of file + value: 128Mi diff --git a/openshift/templates/aries-endorser-wallet/aries-endorser-wallet-deploy.yaml b/openshift/templates/aries-endorser-wallet/aries-endorser-wallet-deploy.yaml index 2effa405..555202c6 100755 --- a/openshift/templates/aries-endorser-wallet/aries-endorser-wallet-deploy.yaml +++ b/openshift/templates/aries-endorser-wallet/aries-endorser-wallet-deploy.yaml @@ -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 @@ -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: @@ -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