From be9f4164bd1279cd5db5d2c51fb382fb9d8f0596 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Mon, 7 Oct 2024 16:37:22 -0700 Subject: [PATCH] chore(ci): remove old templates --- api/openshift.deploy.yml | 223 ---------------------------------- common/openshift.init.yml | 94 -------------- frontend/openshift.deploy.yml | 186 ---------------------------- 3 files changed, 503 deletions(-) delete mode 100644 api/openshift.deploy.yml delete mode 100644 common/openshift.init.yml delete mode 100644 frontend/openshift.deploy.yml diff --git a/api/openshift.deploy.yml b/api/openshift.deploy.yml deleted file mode 100644 index 2c3b4bef..00000000 --- a/api/openshift.deploy.yml +++ /dev/null @@ -1,223 +0,0 @@ -apiVersion: template.openshift.io/v1 -kind: Template -labels: - app: ${NAME}-${ZONE} - app.kubernetes.io/part-of: ${NAME}-${ZONE} -parameters: - - name: NAME - description: Module name - value: pubcode - - name: COMPONENT - description: Component name - value: api - - name: ZONE - description: Deployment zone, e.g. pr-### or prod - required: true - - name: IMAGE_TAG - description: Image tag to use - value: latest - - name: ROUTE - description: URL for route - required: true - - name: CPU_REQUEST - value: "25m" - - name: MEMORY_REQUEST - value: "50Mi" - - name: CPU_LIMIT - value: "75m" - - name: MEMORY_LIMIT - value: "150Mi" - - name: MIN_REPLICAS - description: The minimum amount of replicas for the horizontal pod autoscaler. - value: "3" - - name: MAX_REPLICAS - description: The maximum amount of replicas for the horizontal pod autoscaler. - value: "5" - - name: REGISTRY - description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000) - value: ghcr.io - - name: ORG - description: GitHub organization for using ghcr.io - value: bcgov - - name: PROMOTE - description: Image (namespace/name:tag) to promote/import - value: bcgov/pubcode/api:test -objects: - - apiVersion: v1 - kind: ImageStream - metadata: - labels: - app: ${NAME}-${ZONE} - name: ${NAME}-${ZONE}-${COMPONENT} - spec: - lookupPolicy: - local: false - tags: - - name: ${IMAGE_TAG} - from: - kind: DockerImage - name: ${REGISTRY}/${PROMOTE} - referencePolicy: - type: Local - - apiVersion: v1 - kind: DeploymentConfig - metadata: - labels: - app: ${NAME}-${ZONE} - name: ${NAME}-${ZONE}-${COMPONENT} - spec: - replicas: 1 - triggers: - - type: ConfigChange - - type: ImageChange - imageChangeParams: - automatic: true - containerNames: - - ${NAME} - from: - kind: ImageStreamTag - name: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} - selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} - strategy: - type: Rolling - template: - metadata: - labels: - app: ${NAME}-${ZONE} - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} - spec: - containers: - - image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} - imagePullPolicy: Always - name: ${NAME} - env: - - name: DB_HOST - value: ${NAME}-${ZONE}-database - - name: DB_PWD - valueFrom: - secretKeyRef: - name: ${NAME}-${ZONE}-database - key: database-admin-password - - name: DB_USER - valueFrom: - secretKeyRef: - name: ${NAME}-${ZONE}-database - key: database-admin-user - - name: DB_NAME - valueFrom: - secretKeyRef: - name: ${NAME}-${ZONE}-database - key: database-name - - name: API_KEY - valueFrom: - secretKeyRef: - name: ${NAME}-${ZONE}-api - key: api_key - - name: EMAIL_RECIPIENTS - valueFrom: - secretKeyRef: - name: ${NAME}-${ZONE}-api - key: email_recipients - - name: CHES_TOKEN_URL - valueFrom: - secretKeyRef: - name: ${NAME}-${ZONE}-api - key: ches_token_url - - name: CHES_CLIENT_ID - valueFrom: - secretKeyRef: - name: ${NAME}-${ZONE}-api - key: ches_client_id - - name: CHES_CLIENT_SECRET - valueFrom: - secretKeyRef: - name: ${NAME}-${ZONE}-api - key: ches_client_secret - - name: CHES_API_URL - valueFrom: - secretKeyRef: - name: ${NAME}-${ZONE}-api - key: ches_api_url - - ports: - - containerPort: 3000 - protocol: TCP - resources: - requests: - cpu: ${CPU_REQUEST} - memory: ${MEMORY_REQUEST} - limits: - cpu: ${CPU_LIMIT} - memory: ${MEMORY_LIMIT} - readinessProbe: - httpGet: - path: /api/pub-code/health - port: 3000 - scheme: HTTP - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 20 - livenessProbe: - successThreshold: 1 - failureThreshold: 5 - httpGet: - path: /api/pub-code/health - port: 3000 - scheme: HTTP - initialDelaySeconds: 60 - periodSeconds: 60 - timeoutSeconds: 5 - - - apiVersion: v1 - kind: Service - metadata: - labels: - app: ${NAME}-${ZONE} - name: ${NAME}-${ZONE}-${COMPONENT} - spec: - ports: - - name: 3000-tcp - protocol: TCP - port: 80 - targetPort: 3000 - selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} - - apiVersion: route.openshift.io/v1 - kind: Route - metadata: - labels: - app: ${NAME}-${ZONE} - name: ${NAME}-${ZONE}-${COMPONENT} - annotations: - haproxy.router.openshift.io/balance: roundrobin - spec: - host: ${ROUTE} - port: - targetPort: 3000-tcp - to: - kind: Service - name: ${NAME}-${ZONE}-${COMPONENT} - weight: 100 - tls: - termination: edge - insecureEdgeTerminationPolicy: Redirect - - apiVersion: autoscaling/v2 - kind: HorizontalPodAutoscaler - metadata: - name: ${NAME}-${ZONE}-${COMPONENT} - spec: - scaleTargetRef: - apiVersion: apps.openshift.io/v1 - kind: DeploymentConfig - name: ${NAME}-${ZONE}-${COMPONENT} - minReplicas: ${{MIN_REPLICAS}} - maxReplicas: ${{MAX_REPLICAS}} - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 100 diff --git a/common/openshift.init.yml b/common/openshift.init.yml deleted file mode 100644 index 1d654faf..00000000 --- a/common/openshift.init.yml +++ /dev/null @@ -1,94 +0,0 @@ -apiVersion: template.openshift.io/v1 -kind: Template -parameters: - - name: NAME - description: Product name - value: pubcode - - name: DATABASE - description: Postgres database name - value: database - - name: API - description: API name - value: api - - name: ZONE - description: Deployment zone, e.g. pr-### or prod - required: true - - name: PROMOTE - description: Dummy param, for convenience in deployments - generate: expression - - name: GENERATED_ADMIN_PASSWORD - description: Password for the mongodb connection admin user. - from: "[a-zA-Z0-9]{32}" - generate: expression - - name: API_KEY - description: KEY for the API - from: "[a-zA-Z0-9]{32}" - generate: expression - - name: EMAIL_RECIPIENTS - description: Email Recipients - required: true - - name: CHES_TOKEN_URL - description: Token URL for CHES - required: true - - name: CHES_CLIENT_ID - description: Client ID for CHES - required: true - - name: CHES_CLIENT_SECRET - description: Client Secret for CHES - required: true - - name: CHES_API_URL - description: URL for CHES API - required: true - -objects: - - apiVersion: v1 - kind: Secret - metadata: - name: ${NAME}-${ZONE}-${DATABASE} - labels: - app: ${NAME}-${ZONE} - stringData: - database-admin-password: ${GENERATED_ADMIN_PASSWORD} - database-admin-user: admin - database-name: ${NAME} - - apiVersion: v1 - kind: Secret - metadata: - name: ${NAME}-${ZONE}-${API} - labels: - app: ${NAME}-${ZONE} - stringData: - api_key: ${API_KEY} - email_recipients: ${EMAIL_RECIPIENTS} - ches_token_url: ${CHES_TOKEN_URL} - ches_client_id: ${CHES_CLIENT_ID} - ches_client_secret: ${CHES_CLIENT_SECRET} - ches_api_url: ${CHES_API_URL} - - apiVersion: networking.k8s.io/v1 - kind: NetworkPolicy - metadata: - name: allow-from-openshift-ingress - labels: - template: openshift-test - spec: - podSelector: {} - ingress: - - from: - - namespaceSelector: - matchLabels: - network.openshift.io/policy-group: ingress - policyTypes: - - Ingress - - apiVersion: networking.k8s.io/v1 - kind: NetworkPolicy - metadata: - name: allow-same-namespace - labels: - template: quickstart-network-security-policy - spec: - podSelector: {} - ingress: - - from: - - podSelector: {} - policyTypes: - - Ingress diff --git a/frontend/openshift.deploy.yml b/frontend/openshift.deploy.yml deleted file mode 100644 index 5055f5e7..00000000 --- a/frontend/openshift.deploy.yml +++ /dev/null @@ -1,186 +0,0 @@ -apiVersion: template.openshift.io/v1 -kind: Template -labels: - app: ${NAME}-${ZONE} - app.kubernetes.io/part-of: ${NAME}-${ZONE} -parameters: - - name: NAME - description: Module name - value: pubcode - - name: COMPONENT - description: Component name - value: frontend - - name: ZONE - description: Deployment zone, e.g. pr-### or prod - required: true - - name: IMAGE_TAG - description: Image tag to use - value: latest - - name: ROUTE - description: URL for route - required: true - - name: CPU_REQUEST - value: "25m" - - name: MEMORY_REQUEST - value: "50Mi" - - name: CPU_LIMIT - value: "75m" - - name: MEMORY_LIMIT - value: "150Mi" - - name: MIN_REPLICAS - description: The minimum amount of replicas for the horizontal pod autoscaler. - value: "3" - - name: MAX_REPLICAS - description: The maximum amount of replicas for the horizontal pod autoscaler. - value: "5" - - name: REGISTRY - description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000) - value: ghcr.io - - name: PROMOTE - description: Image (namespace/name:tag) to promote/import - value: bcgov/pubcode/frontend:test - - name: LOG_LEVEL - description: Caddy logging level DEBUG, INFO, WARN, ERROR, PANIC, and FATAL (https://github.com/caddyserver/caddy/blob/master/logging.go) - value: "info" - - name: VITE_SCHEMA_BRANCH - description: Vite schema branch to use - value: "main" # override with values for PR based deployment. -objects: - - apiVersion: v1 - kind: ImageStream - metadata: - labels: - app: ${NAME}-${ZONE} - name: ${NAME}-${ZONE}-${COMPONENT} - spec: - lookupPolicy: - local: false - tags: - - name: ${IMAGE_TAG} - from: - kind: DockerImage - name: ${REGISTRY}/${PROMOTE} - referencePolicy: - type: Local - - apiVersion: v1 - kind: DeploymentConfig - metadata: - labels: - app: ${NAME}-${ZONE} - name: ${NAME}-${ZONE}-${COMPONENT} - spec: - replicas: 1 - triggers: - - type: ConfigChange - - type: ImageChange - imageChangeParams: - automatic: true - containerNames: - - ${NAME} - from: - kind: ImageStreamTag - name: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} - selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} - strategy: - type: Rolling - template: - metadata: - labels: - app: ${NAME}-${ZONE} - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} - spec: - containers: - - image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} - securityContext: - capabilities: - add: ["NET_BIND_SERVICE"] - imagePullPolicy: Always - name: ${NAME} - env: - - name: LOG_LEVEL - value: ${LOG_LEVEL} - - name: VITE_SCHEMA_BRANCH - value: ${VITE_SCHEMA_BRANCH} - ports: - - containerPort: 3000 - protocol: TCP - resources: - requests: - cpu: ${CPU_REQUEST} - memory: ${MEMORY_REQUEST} - limits: - cpu: ${CPU_LIMIT} - memory: ${MEMORY_LIMIT} - readinessProbe: - httpGet: - path: /health - port: 3001 - scheme: HTTP - initialDelaySeconds: 2 - periodSeconds: 2 - timeoutSeconds: 1 - successThreshold: 1 - failureThreshold: 30 - livenessProbe: - successThreshold: 1 - failureThreshold: 3 - httpGet: - path: /health - port: 3001 - scheme: HTTP - initialDelaySeconds: 30 - periodSeconds: 30 - timeoutSeconds: 5 - - apiVersion: v1 - kind: Service - metadata: - labels: - app: ${NAME}-${ZONE} - name: ${NAME}-${ZONE}-${COMPONENT} - spec: - ports: - - name: 3000-tcp - protocol: TCP - port: 80 - targetPort: 3000 - selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} - - apiVersion: route.openshift.io/v1 - kind: Route - metadata: - labels: - app: ${NAME}-${ZONE} - name: ${NAME}-${ZONE}-${COMPONENT} - annotations: - haproxy.router.openshift.io/balance: roundrobin - - spec: - host: ${ROUTE} - port: - targetPort: 3000-tcp - to: - kind: Service - name: ${NAME}-${ZONE}-${COMPONENT} - weight: 100 - tls: - termination: edge - insecureEdgeTerminationPolicy: Redirect - - apiVersion: autoscaling/v2 - kind: HorizontalPodAutoscaler - metadata: - name: ${NAME}-${ZONE}-${COMPONENT} - spec: - scaleTargetRef: - apiVersion: apps.openshift.io/v1 - kind: DeploymentConfig - name: ${NAME}-${ZONE}-${COMPONENT} - minReplicas: ${{MIN_REPLICAS}} - maxReplicas: ${{MAX_REPLICAS}} - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 100