Skip to content

Commit

Permalink
Merge pull request #60 from tonytheleg/ARO-6291-add-deployment-manifest
Browse files Browse the repository at this point in the history
adds basic deploy template for frontend
  • Loading branch information
mjlshen authored Apr 18, 2024
2 parents 44ac8ac + 180766f commit 8c7dcb9
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SHELL = /bin/bash
TAG ?= $(shell git describe --exact-match 2>/dev/null)
COMMIT = $(shell git rev-parse --short=7 HEAD)$(shell [[ $$(git status --porcelain) = "" ]] || echo -dirty)
# There is currently no ACR for ARO HCP components. Variable will be defined later
ARO_HCP_BASE_IMAGE = ${ARO_HCP_IMAGE_ACR}.azurecr.io
ARO_HCP_BASE_IMAGE ?= ${ARO_HCP_IMAGE_ACR}.azurecr.io

ifeq ($(TAG),)
VERSION = $(COMMIT)
Expand Down Expand Up @@ -34,3 +34,9 @@ frontend-multistage:

clean:
rm aro-hcp-frontend

deploy-frontend:
oc process -f ./deploy/aro-hcp-frontend.yml -p ARO_HCP_FRONTEND_IMAGE=${ARO_HCP_FRONTEND_IMAGE} | oc replace -f -

undeploy-frontend:
oc process -f ./deploy/aro-hcp-frontend.yml -p ARO_HCP_FRONTEND_IMAGE=${ARO_HCP_FRONTEND_IMAGE} | oc delete -f -
63 changes: 63 additions & 0 deletions deploy/aro-hcp-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: frontend-template

parameters:
- name: NAMESPACE
required: true
value: aro-hcp
- name: REPLICAS
required: true
value: "1"
- name: ARO_HCP_FRONTEND_IMAGE
required: true

objects:
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: aro-hcp-frontend
name: aro-hcp-frontend
namespace: ${NAMESPACE}
spec:
progressDeadlineSeconds: 600
replicas: ${{REPLICAS}}
revisionHistoryLimit: 10
selector:
matchLabels:
app: aro-hcp-frontend
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: aro-hcp-frontend
spec:
containers:
- name: aro-hcp-frontend
image: ${ARO_HCP_FRONTEND_IMAGE}
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8443
protocol: TCP
resources:
limits:
memory: 1Gi
requests:
cpu: 100m
memory: 500Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
restartPolicy: Always
terminationGracePeriodSeconds: 30
12 changes: 11 additions & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ make frontend

To create a cluster, follow the instructions in [development-setup.md][../dev-infrastructure/docs/development-setup.md]

## Deploy/Undeploy frontend in a cluster

```bash
# Deploy
make deploy-frontend

# Undeploy
make undeploy-frontend
```

## Available endpoints

List the Operations for the Provider
Expand Down Expand Up @@ -38,4 +48,4 @@ curl -X PUT "https://localhost:8443/subscriptions/YOUR_SUBSCRIPTION_ID/resourceG
Delete a HcpOpenShiftClusterResource
```bash
curl -X DELETE "https://localhost:8443/subscriptions/YOUR_SUBSCRIPTION_ID/resourceGroups/YOUR_RESOURCE_GROUP_NAME/providers/Microsoft.RedHatOpenshift/hcpOpenShiftClusters/YOUR_CLUSTER_NAME?api-version=2024-06-10-preview"
```
```

0 comments on commit 8c7dcb9

Please sign in to comment.