Skip to content

Commit

Permalink
Modues edge native (#71)
Browse files Browse the repository at this point in the history
* edge-native modules changes

* edge-native modules changes

* Edge native module changes

* edge-native modules changes

* PLT-534: Edge native support release.

---------

Co-authored-by: nikolay-spectro <[email protected]>
  • Loading branch information
rishi-anand and nikchern authored Jun 23, 2023
1 parent a28b5c9 commit 242f792
Show file tree
Hide file tree
Showing 7 changed files with 388 additions and 1 deletion.
135 changes: 135 additions & 0 deletions examples/edge-native/config/cluster/cluster-ehl-ams.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: hospital-2
cloudType: edge-native
skip_completion: true
tags:
- "skip_completion"
profiles:
infra:
name: opensuse-pxke-infra
context: tenant
version: 1.24.6-os-v15.4
addons:
- name: org1-bootstrap-stable
version: 1.0.110
- name: org1-security-services-bootstrap-stable
version: 1.0.5
- name: org1-aca-bootstrap-stable
version: 1.0.13
- name: org1-reloader-stable
version: 1.0.2
- name: org1-iris-stable
version: 1.0.9
- name: org1-logging-monitoring-services-stable
version: 1.0.83
- name: org1-storage-monitoring-stable
version: 1.0.4
- name: org1-metacontroller-stable
version: 1.0.8
- name: org1-common-postgres-stable
version: 1.0.21
- name: org1-security-postgres-stable
version: 1.0.22
- name: org1-aca-crd-stable
version: 1.0.33
- name: org1-logging-monitoring-aca-stable
version: 1.0.30
- name: org1-security-system-gateway-stable
version: 1.0.60
- name: org1-siteconfig-stable
version: 1.0.111
packs:
- name: org2-site-config-aca-chart
version: 0.0.0-zd3a4f18
override_type: params
params:
hw_pwd_enabled: true
ilo_enabled: true
dual_wan_enabled: true
registry: helm-blr-ees
- name: org1-security-certificate-management-stable
version: 1.0.55
- name: org1-security-device-management-stable
version: 1.0.21
- name: org1-system-health-stable
version: 1.0.69
packs:
- name: org2-cpu-webcomponent
version: 0.1.0-z596c17c
override_type: params
params:
toggle_enabled: true
registry: helm-blr-ees
- name: org2-ram-webcomponent
version: 0.1.0-z8fec9e6
override_type: params
params:
toggle_enabled: true
registry: helm-blr-ees
- name: org1-security-idam-stable
version: 1.0.106
- name: org1-admin-console-stable
version: 1.0.89
packs:
- name: eis-admin-console-dynamic-portal
version: 0.0.0-zf499b45
override_type: params
params:
host_pwr_mgt_enabled: true
healthlink_enabled: false
registry: helm-blr-ees
- name: org1-security-api-gateway-stable
version: 1.0.65
- name: org1-security-auditing-stable
version: 1.0.30
- name: org1-imaging-device-manager-stable
version: 1.0.27
- name: org1-aca-stable
version: 1.0.31
packs:
- name: eis-ilo-aca-crd
version: 0.0.1-z0406cbc
override_type: params
params:
enabled: true
registry: helm-blr-ees
- name: org1-security-malware-management-stable
version: 1.0.41
- name: org1-security-logging-monitoring-services-stable
version: 1.0.14
- name: org1-security-admission-controller-stable
version: 1.0.33
- name: org1-hardware-monitoring-stable
version: 1.0.11
- name: org1-network-monitoring-stable
version: 1.0.6
- name: org1-k8-cert-renewal-stable
version: 1.0.7
- name: org1-licensingservice-stable
version: 1.0.34
- name: org1-priority-scheduler-stable
version: 1.0.28
- name: org1-rabbitmq-service-stable
version: 1.0.20
- name: org1-backup-service-stable
version: 1.0.76
packs:
- name: org2-minio
version: 0.0.1-z0ef7f65
override_type: params
params:
mode: standalone
registry: helm-blr-ees
- name: org1-security-audit-viewer-stable
version: 1.0.21
- name: org1-axone-profile
version: 1.26.13
cloud_config:
ssh_key: "ssh-rsa AAqd spectrocloud2022"
vip: 10.184.225.107
ntp_servers: ["pool.ntp.org"]
node_groups:
- name: master-pool
control_plane: true
control_plane_as_worker: true
count: 1
host_uids: ["node-103", "node-104", "node-105"]
48 changes: 48 additions & 0 deletions examples/edge-native/mod_spectro_org.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
locals {
accounts_params = { ACCOUNT_DEV_NAME = "dev-030", ACCOUNT_PROD_NAME = "prod-004" }
appliances_params = {}
bsl_params = { BSL_NAME = "qa-sharma" }
profile_params = {
SPECTRO_REPO_URL = "https://registry.spectrocloud.com",
REPO_URL = "593235963820.dkr.ecr.us-west-2.amazonaws.com",
OIDC_CLIENT_ID = "5ajs8pq0gatbgpjejld96fldrn",
OIDC_ISSUER_URL = "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_ajvPoziaS",
RABBITMQ_PACK_VERSION = "8.15.2",
string = "$${string}",
ADDON_SPECTRO_REPO_URL = "https://addon-registry.spectrocloud.com",
}
projects_params = {}
clusters_params = {}
}

module "SpectroOrg" {
source = "../../"
//source = "git::https://github.com/spectrocloud/terraform-spectrocloud-modules.git?ref=edge-native-changes"

accounts = {
for k in fileset("config/account", "account-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/account/${k}", local.accounts_params))
}

appliances = {
for k in fileset("config/appliance", "appliance-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/appliance/${k}", local.appliances_params))
}

profiles = {
for k in fileset("config/profile", "profile-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/profile/${k}", local.profile_params))
}
}


module "SpectroProject" {
depends_on = [module.SpectroOrg]
source = "../../"
//source = "git::https://github.com/spectrocloud/terraform-spectrocloud-modules.git?ref=edge-native-changes"

clusters = {
for k in fileset("config/cluster", "cluster-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/cluster/${k}", local.accounts_params))
}
}
29 changes: 29 additions & 0 deletions examples/edge-native/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
terraform {
required_providers {


spectrocloud = {
source = "spectrocloud/spectrocloud"
}
}
}

variable "sc_host" {
description = "Spectro Cloud Endpoint"
default = "api.spectrocloud.com"
}

variable "sc_api_key" {
description = "Spectro Cloud API key"
}

variable "sc_project_name" {
description = "Spectro Cloud Project (e.g: Default)"
default = "Default"
}

provider "spectrocloud" {
host = var.sc_host
api_key = var.sc_api_key
project_name = var.sc_project_name
}
4 changes: 4 additions & 0 deletions examples/edge-native/terraform.template.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Spectro Cloud credentials
sc_host = "{enter Spectro Cloud API endpoint}" #e.g: api.spectrocloud.com (for SaaS)
sc_api_key = "{enter Spectro Cloud API Key}" #e.g: Q28GBs7ssdvNNkERWeWpqwSLfI1nnit6W
sc_project_name = "{enter Spectro Cloud project Name}" #e.g: Default
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ terraform {
}
}

required_version = "~> 1.4.4"
required_version = "> 1.4.4"
}
2 changes: 2 additions & 0 deletions spectro-cluster-common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ locals {
edge_vsphere_clusters = [for key in local.edge_vsphere_keys : lookup(local.cluster_map, key)]
edge_keys = compact([for i, cluster in local.cluster_map : cluster.cloudType == "edge" ? i : ""])
edge_clusters = [for key in local.edge_keys : lookup(local.cluster_map, key)]
edge_native_keys = compact([for i, cluster in local.cluster_map : cluster.cloudType == "edge-native" ? i : ""])
edge_native_clusters = [for key in local.edge_native_keys : lookup(local.cluster_map, key)]
// all edge clusters (this is for appliance list)
all_edge_clusters = setunion(local.libvirt_clusters)
}
Expand Down
Loading

0 comments on commit 242f792

Please sign in to comment.