From 8a779df3229409ee95154228cf2ecb70db703f1a Mon Sep 17 00:00:00 2001 From: ychung-mot Date: Tue, 13 Sep 2022 10:04:13 -0700 Subject: [PATCH 1/2] openshift files --- openshift/camera-web-app-deployment.yaml | 3 +- ...hostcms-configmap.yaml => configmaps.yaml} | 2 +- openshift/drivebc-open511-build.yaml | 32 +++++ openshift/drivebc-open511-deployment.yaml | 84 +++++++++++++ openshift/ghostcms-deployment.yaml | 117 ++++++++++++++++++ openshift/open511-ghostcms-deployment.yaml | 19 ++- openshift/secrets.yaml | 2 +- 7 files changed, 253 insertions(+), 6 deletions(-) rename openshift/{open511-ghostcms-configmap.yaml => configmaps.yaml} (91%) create mode 100644 openshift/drivebc-open511-build.yaml create mode 100644 openshift/drivebc-open511-deployment.yaml create mode 100644 openshift/ghostcms-deployment.yaml diff --git a/openshift/camera-web-app-deployment.yaml b/openshift/camera-web-app-deployment.yaml index 4b58a95..b0c9d75 100644 --- a/openshift/camera-web-app-deployment.yaml +++ b/openshift/camera-web-app-deployment.yaml @@ -80,7 +80,6 @@ kind: Route metadata: annotations: haproxy.router.openshift.io/timeout: 5m - creationTimestamp: null name: camera-web-app spec: host: camera-web-app-b07b69-dev.apps.silver.devops.gov.bc.ca @@ -98,7 +97,7 @@ spec: kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: - name: camera-web-app + name: allow-camera-web-app spec: podSelector: matchLabels: diff --git a/openshift/open511-ghostcms-configmap.yaml b/openshift/configmaps.yaml similarity index 91% rename from openshift/open511-ghostcms-configmap.yaml rename to openshift/configmaps.yaml index 4e68dba..6a53bdd 100644 --- a/openshift/open511-ghostcms-configmap.yaml +++ b/openshift/configmaps.yaml @@ -7,4 +7,4 @@ data: camel.zipkin.endpoint: "http://zipkin:9411/api/v2/spans" drivebc-ghostcms.camel.cron: 0+0/10+*+*+*+? logstash.host: logstash-local - logstash.port: "8002" + logstash.port: "8002" \ No newline at end of file diff --git a/openshift/drivebc-open511-build.yaml b/openshift/drivebc-open511-build.yaml new file mode 100644 index 0000000..fcb410d --- /dev/null +++ b/openshift/drivebc-open511-build.yaml @@ -0,0 +1,32 @@ +kind: ImageStream +apiVersion: image.openshift.io/v1 +metadata: + labels: + shared: "true" + name: drivebc-open511 +spec: + lookupPolicy: + local: false +--- +kind: BuildConfig +apiVersion: build.openshift.io/v1 +metadata: + name: drivebc-open511 +spec: + runPolicy: Serial + output: + to: + kind: ImageStreamTag + name: drivebc-open511:latest + source: + git: + uri: https://github.com/bcgov/Enterprise-Connector.git + ref: "0.12" + type: Git + contextDir: integrations/drivebc-open511 + strategy: + sourceStrategy: + from: + kind: DockerImage + name: image-registry.openshift-image-registry.svc:5000/openshift/java:openjdk-11-el7 + type: Source diff --git a/openshift/drivebc-open511-deployment.yaml b/openshift/drivebc-open511-deployment.yaml new file mode 100644 index 0000000..d662293 --- /dev/null +++ b/openshift/drivebc-open511-deployment.yaml @@ -0,0 +1,84 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: drivebc-open511 + labels: + app: drivebc-open511 + app.kubernetes.io/part-of: Integrations +spec: + replicas: 1 + selector: + matchLabels: + app: drivebc-open511 + template: + metadata: + labels: + app: drivebc-open511 + deploymentconfig: drivebc-open511 + spec: + containers: + - name: drivebc-open511 + image: >- + image-registry.openshift-image-registry.svc:5000/b07b69-tools/drivebc-open511 + ports: + - containerPort: 8080 + protocol: TCP + - containerPort: 8443 + protocol: TCP + - containerPort: 8082 + protocol: TCP + env: + - name: ZIPKIN_HOST + valueFrom: + configMapKeyRef: + name: ecp-camel-config + key: camel.zipkin.endpoint + - name: LOGSTASH_HOST + valueFrom: + configMapKeyRef: + name: ecp-camel-config + key: logstash.host + - name: LOGSTASH_PORT + valueFrom: + configMapKeyRef: + name: ecp-camel-config + key: logstash.port + resources: + requests: + cpu: 50m + memory: 300Mi + limits: + cpu: 100m + memory: 400Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + imagePullPolicy: Always + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst + securityContext: {} + schedulerName: default-scheduler + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 25% + maxSurge: 25% + revisionHistoryLimit: 10 + progressDeadlineSeconds: 600 +--- +kind: NetworkPolicy +apiVersion: networking.k8s.io/v1 +metadata: + name: allow-drivebc-open511 +spec: + podSelector: + matchLabels: + deploymentconfig: drivebc-open511 + ingress: + - ports: + - protocol: TCP + port: 8081 + - protocol: TCP + port: 8082 + policyTypes: + - Ingress \ No newline at end of file diff --git a/openshift/ghostcms-deployment.yaml b/openshift/ghostcms-deployment.yaml new file mode 100644 index 0000000..177e2a3 --- /dev/null +++ b/openshift/ghostcms-deployment.yaml @@ -0,0 +1,117 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: ghostcms-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + storageClassName: netapp-file-standard +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: ghostcms + labels: + app: ghostcms + app.kubernetes.io/part-of: Content-Management +spec: + replicas: 1 + selector: + matchLabels: + app: ghostcms + template: + metadata: + labels: + app: ghostcms + deploymentconfig: ghostcms + spec: + volumes: + - name: ghostcms-1 + persistentVolumeClaim: + claimName: ghostcms-pvc + containers: + - name: ghostcms + env: + - name: url + value: 'https://ghostcms-b07b69-dev.apps.silver.devops.gov.bc.ca/' + image: >- + image-registry.openshift-image-registry.svc:5000/b07b69-tools/ghostcms + ports: + - containerPort: 2368 + protocol: TCP + resources: + requests: + cpu: 500m + memory: 256Mi + limits: + cpu: 800m + memory: 500Mi + volumeMounts: + - name: ghostcms-1 + mountPath: /var/lib/ghost/content + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + imagePullPolicy: IfNotPresent + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst + securityContext: {} + schedulerName: default-scheduler + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 25% + maxSurge: 25% + revisionHistoryLimit: 10 + progressDeadlineSeconds: 600 +--- +apiVersion: v1 +kind: Service +metadata: + name: ghostcms +spec: + ports: + - name: web + port: 2368 + protocol: TCP + targetPort: 2368 + selector: + deploymentconfig: ghostcms +--- +apiVersion: route.openshift.io/v1 +kind: Route +metadata: + annotations: + haproxy.router.openshift.io/timeout: 5m + creationTimestamp: null + name: ghostcms +spec: + host: ghostcms-b07b69-test.apps.silver.devops.gov.bc.ca + path: "/" + port: + targetPort: web + tls: + termination: edge + to: + kind: Service + name: ghostcms + weight: 100 + wildcardPolicy: None +--- +kind: NetworkPolicy +apiVersion: networking.k8s.io/v1 +metadata: + name: allow-ghostcms +spec: + podSelector: + matchLabels: + deploymentconfig: ghostcms + ingress: + - ports: + - protocol: TCP + port: 2368 + policyTypes: + - Ingress diff --git a/openshift/open511-ghostcms-deployment.yaml b/openshift/open511-ghostcms-deployment.yaml index 067f2cc..dbaa3d1 100644 --- a/openshift/open511-ghostcms-deployment.yaml +++ b/openshift/open511-ghostcms-deployment.yaml @@ -19,10 +19,10 @@ spec: containers: - resources: requests: - cpu: 50m + cpu: 300m memory: 300Mi limits: - cpu: 100m + cpu: 500m memory: 400Mi terminationMessagePath: /dev/termination-log name: open511-ghostcms @@ -88,3 +88,18 @@ spec: maxSurge: 25% revisionHistoryLimit: 10 progressDeadlineSeconds: 600 +--- +kind: NetworkPolicy +apiVersion: networking.k8s.io/v1 +metadata: + name: allow-open511-ghostcms +spec: + podSelector: + matchLabels: + deploymentconfig: open511-ghostcms + ingress: + - ports: + - protocol: TCP + port: 8080 + policyTypes: + - Ingress \ No newline at end of file diff --git a/openshift/secrets.yaml b/openshift/secrets.yaml index 3f0ee29..f2e43b7 100644 --- a/openshift/secrets.yaml +++ b/openshift/secrets.yaml @@ -19,4 +19,4 @@ stringData: Url: value Ssa: value Interval: "30" -type: Opaque +type: Opaque \ No newline at end of file From c17d0b822764c1e70a9c0bc94da4a8c71d01c197 Mon Sep 17 00:00:00 2001 From: ychung-mot Date: Thu, 15 Sep 2022 07:15:08 -0700 Subject: [PATCH 2/2] typo --- openshift/ghostcms-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openshift/ghostcms-deployment.yaml b/openshift/ghostcms-deployment.yaml index 177e2a3..43c8653 100644 --- a/openshift/ghostcms-deployment.yaml +++ b/openshift/ghostcms-deployment.yaml @@ -89,7 +89,7 @@ metadata: creationTimestamp: null name: ghostcms spec: - host: ghostcms-b07b69-test.apps.silver.devops.gov.bc.ca + host: ghostcms-b07b69-dev.apps.silver.devops.gov.bc.ca path: "/" port: targetPort: web