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

adds basic deploy template for frontend #60

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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"
```
```