Skip to content

Commit

Permalink
deploy aro-hcp env using upstream.
Browse files Browse the repository at this point in the history
Signed-off-by: morvencao <[email protected]>
  • Loading branch information
morvencao committed Nov 4, 2024
1 parent 93dcf55 commit c932790
Show file tree
Hide file tree
Showing 63 changed files with 65 additions and 4,281 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ test/e2e/.consumer_name
test/e2e/.external_host_ip
test/e2e/report/*
unit-test-results.json
integration-test-results.json
integration-test-results.json

test/e2e/setup/aro/aro-hcp
62 changes: 62 additions & 0 deletions test/e2e/setup/aro/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# define the variables
REPO_URL = [email protected]:Azure/ARO-HCP.git
BRANCH = maestro-light-setup
CLONE_DIR = aro-hcp

# clone the repo
clone:
@if [ -d $(CLONE_DIR) ]; then \
echo "Removing existing directory $(CLONE_DIR)..."; \
rm -rf $(CLONE_DIR); \
fi; \
echo "Cloning repository..."; \
git clone $(REPO_URL) -b $(BRANCH) $(CLONE_DIR)
.PHONY: clone

# create the cluster (svc-cluster or mgmt-cluster)
cluster: clone
ifndef AKSCONFIG
$(error "Must set AKSCONFIG")
endif
@$(MAKE) -C $(CLONE_DIR)/dev-infrastructure cluster
.PHONY: cluster

# grant admin access to the cluster
aks.admin-access:
ifndef AKSCONFIG
$(error "Must set AKSCONFIG")
endif
@$(MAKE) -C $(CLONE_DIR)/dev-infrastructure aks.admin-access
.PHONY: aks.admin-access

# retrieve the kubeconfig
aks.kubeconfig:
ifndef AKSCONFIG
$(error "Must set AKSCONFIG")
endif
@$(MAKE) -C $(CLONE_DIR)/dev-infrastructure aks.kubeconfig
.PHONY: aks.kubeconfig

# deploy the maestro server
deploy-server:
@AKSCONFIG=svc-cluster $(MAKE) -C $(CLONE_DIR)/maestro deploy-server
.PHONY: deploy-server

# deploy the maestro agent
deploy-agent:
@AKSCONFIG=mgmt-cluster $(MAKE) -C $(CLONE_DIR)/maestro deploy-agent
.PHONY: deploy-agent

# register the maestro agent
register-agent:
@AKSCONFIG=svc-cluster $(MAKE) -C $(CLONE_DIR)/maestro register-agent
.PHONY: register-agent

# clean up the resources
clean:
ifndef AKSCONFIG
$(error "Must set AKSCONFIG")
endif
@$(MAKE) -C $(CLONE_DIR)/dev-infrastructure clean
@rm -rf $(CLONE_DIR)
.PHONY: clean
20 changes: 0 additions & 20 deletions test/e2e/setup/aro/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
# Maestro ARO-HCP Env Setup

## Background

The idea of this directory is to provide means to create a development or testing environment that resemble the (future) production setup in a repeatable way. In order to do so, the creation of all infrastructure resources is based on bicep templates and parameter files.

## Prerequisites

* `az` version >= 2.60, `jq`, `make`, [kubelogin](https://azure.github.io/kubelogin/install.html), `kubectl` version >= 1.30, `helm`
* `az login` with service principal (azure AD user support is WIP)
* Register the needed [AFEC](https://aka.ms/afec) feature flags using `cd cluster && make feature-registration`
* __NOTE:__ This will take awhile, you will have to wait until they're in a registered state.

## Cluster Creation Procedure

There are a few variants to chose from when creating an AKS cluster:

* Service Cluster: Public AKS cluster with optional params that can be modified to include all Azure resources needed to run a Service cluster
* Management Cluster: Public AKS cluster with optional params that can be modified to include all Azure resources needed to run a Management cluster

When creating a cluster, also supporting infrastructure is created, e.g. managed identities, permissions, databases, keyvaults, ...

### Create Service Cluster

Change those flags accordingly and then run the following command. Depending on the selected features, this may take a while:

```bash
cd cluster
AKSCONFIG=svc-cluster make cluster
```

Expand All @@ -34,7 +18,6 @@ Change those flags accordingly and then run the following command. Depending on
A Management Cluster depends on certain resources found in the resource group of the Service Cluster. Therefore, a standalone Management Cluster can't be created right now and requires a Service Cluster

```bash
cd cluster
AKSCONFIG=mgmt-cluster make cluster
```

Expand All @@ -54,7 +37,6 @@ A Management Cluster depends on certain resources found in the resource group of
Setting the correct `AKSCONFIG`, this will cleanup all resources created in Azure

```bash
cd cluster
AKSCONFIG=svc-cluster make clean
```

Expand All @@ -69,7 +51,6 @@ Setting the correct `AKSCONFIG`, this will cleanup all resources created in Azur
> The service cluster has no ingress. To interact with the services you deploy use `kubectl port-forward`
```bash
cd maestro
AKSCONFIG=svc-cluster make deploy-server
```

Expand Down Expand Up @@ -97,7 +78,6 @@ If you need to restart the maestro server during testing and don't want the port
First install the agent

```bash
cd maestro
AKSCONFIG=mgmt-cluster make deploy-agent
```

Expand Down
135 changes: 0 additions & 135 deletions test/e2e/setup/aro/cluster/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions test/e2e/setup/aro/cluster/configurations/dev.mk

This file was deleted.

28 changes: 0 additions & 28 deletions test/e2e/setup/aro/cluster/configurations/mgmt-cluster.bicepparam

This file was deleted.

9 changes: 0 additions & 9 deletions test/e2e/setup/aro/cluster/configurations/region.bicepparam

This file was deleted.

24 changes: 0 additions & 24 deletions test/e2e/setup/aro/cluster/configurations/svc-cluster.bicepparam

This file was deleted.

Loading

0 comments on commit c932790

Please sign in to comment.