Skip to content

Commit

Permalink
BET-4793: libvirt simplified yaml support. (#17)
Browse files Browse the repository at this point in the history
* Adding local simplified yaml examples.

* BET-4793: libvirt simplified yaml support.

* BET-4793: Edge, Edge-vsphere, eks, tke simplified yaml support.

* Adding local simplified yaml examples.
  • Loading branch information
nikchern authored Apr 12, 2022
1 parent 0679b43 commit 0709f11
Show file tree
Hide file tree
Showing 42 changed files with 4,847 additions and 36 deletions.
54 changes: 49 additions & 5 deletions examples/libvirt/config/cluster/cluster-libvirt-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,45 @@ profiles:
infra:
name: libvirt-gpu-full
system:
name: system-profile
name: system-profile-simyam-libvirt
addons:
- name: addon-profile-1
- name: addon-profile-simyam-libvirt
cloud_config:
ssh_key: spectro2022
vip: 192.168.100.15
cluster_rbac_binding:
- type: "ClusterRoleBinding"
role:
kind: "ClusterRole"
name: "testRole3"
subjects:
- type: "User"
name: "testRoleUser3"
- type: "Group"
name: "testRoleGroup3"
- type: "ServiceAccount"
name: "testrolesubject3"
namespace: "testrolenamespace"
- type: "RoleBinding"
namespace: "test5ns"
role:
kind: "Role"
name: "testRoleFromNS3"
subjects:
- type: "User"
name: "testUserRoleFromNS3"
- type: "Group"
name: "testGroupFromNS3"
- type: "ServiceAccount"
name: "testrolesubject3"
namespace: "testrolenamespace"

namespaces:
- name: "test5ns"
resource_allocation:
cpu_cores: "2"
memory_MiB: "2048"

node_groups:
- name: master-pool
control_plane: true
Expand All @@ -24,7 +57,7 @@ node_groups:
- size_in_gb: 10
managed: false
placements:
- appliance: "libvirt-nik15-mar-21"
- appliance: "libvirt-nik-mar-21"
network_type: "bridge"
network_names: "br0"
network: "br"
Expand All @@ -33,7 +66,7 @@ node_groups:
data_storage_pool: "ehl_data"

- name: worker-pool
count: 3
count: 1
disk_size_gb: 60
memory_mb: 8192
cpu: 4
Expand All @@ -44,14 +77,25 @@ node_groups:
- size_in_gb: 10
managed: true
placements:
- appliance: "libvirt-nik15-mar-21"
- appliance: "libvirt-nik-mar-21"
network_type: "bridge"
network_names: "br0"
network: "br"
image_storage_pool: "ehl_images"
target_storage_pool: "ehl_images"
data_storage_pool: "ehl_data"

additional_labels:
addlabel: "addlabelval1"

taints:
- key: "taintkey1"
value: "taintvalue1"
effect: "PreferNoSchedule"
- key: "taintkey2"
value: "taintvalue2"
effect: "NoSchedule"

scan_policy:
configuration_scan_schedule: "0 0 * * SUN"
penetration_scan_schedule: "0 0 * * SUN"
Expand Down
2 changes: 1 addition & 1 deletion examples/libvirt/config/profile/profile-addon-1.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: addon-profile-1
name: addon-profile-simyam-libvirt
description: addon-profile-1
type: add-on
cloudType: all
Expand Down
24 changes: 12 additions & 12 deletions examples/libvirt/config/profile/profile-libvirt-full-gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ packs:
pack:
content:
images:
- gcr.io/spectro-images-public/calico/kube-controllers:v3.19.0
- gcr.io/spectro-images-public/calico/node:v3.19.0
- gcr.io/spectro-images-public/calico/cni:v3.19.0
- gcr.io/spectro-images-public/calico/pod2daemon-flexvol:v3.19.0
- image: gcr.io/spectro-images-public/calico/kube-controllers:v3.19.0
- image: gcr.io/spectro-images-public/calico/node:v3.19.0
- image: gcr.io/spectro-images-public/calico/cni:v3.19.0
- image: gcr.io/spectro-images-public/calico/pod2daemon-flexvol:v3.19.0
manifests:
calico:
Expand All @@ -178,14 +178,14 @@ packs:
pack:
content:
images:
- k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.3.0
- k8s.gcr.io/sig-storage/csi-attacher:v3.3.0
- k8s.gcr.io/sig-storage/csi-snapshotter:v4.2.0
- k8s.gcr.io/sig-storage/csi-resizer:v1.3.0
- k8s.gcr.io/sig-storage/csi-provisioner:v3.0.0
- quay.io/cephcsi/cephcsi:v3.4.0
- quay.io/ceph/ceph:v16.2.7
- docker.io/rook/ceph:v1.8.0
- image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.3.0
- image: k8s.gcr.io/sig-storage/csi-attacher:v3.3.0
- image: k8s.gcr.io/sig-storage/csi-snapshotter:v4.2.0
- image: k8s.gcr.io/sig-storage/csi-resizer:v1.3.0
- image: k8s.gcr.io/sig-storage/csi-provisioner:v3.0.0
- image: quay.io/cephcsi/cephcsi:v3.4.0
- image: quay.io/ceph/ceph:v16.2.7
- image: docker.io/rook/ceph:v1.8.0
manifests:
storageclass:
Expand Down
2 changes: 1 addition & 1 deletion examples/libvirt/config/profile/profile-system.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: system-profile
name: system-profile-simyam-libvirt
description: system-profile
type: system
cloudType: all
Expand Down
37 changes: 22 additions & 15 deletions examples/libvirt/mod_spectro_org.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
locals {
accounts_params = { ACCOUNT_DEV_NAME = "dev-030", ACCOUNT_PROD_NAME = "prod-004" }
accounts_params = { ACCOUNT_DEV_NAME = "dev-030", ACCOUNT_PROD_NAME = "prod-004" }
appliances_params = {}
bsl_params = { BSL_NAME = "qa-sharma" }
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",
Expand All @@ -18,25 +18,20 @@ locals {
module "SpectroOrg" {
source = "../../"

accounts = {
/*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))
}
}*/

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

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

/*projects = {
for k in fileset("config/project", "project-*.yaml") :
Expand All @@ -55,18 +50,30 @@ module "SpectroOrg" {

}

module "SpectroAppliances" {
depends_on = [module.SpectroOrg]

source = "../../"

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

}

/*
output "debug" {
value = module.SpectroProject.libvirt-cluster
}
*/

module "SpectroProject" {
depends_on = [module.SpectroOrg]
source = "../../"
depends_on = [module.SpectroAppliances]
source = "../../"

/*clusters = {
clusters = {
for k in fileset("config/cluster", "cluster-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/cluster/${k}", local.accounts_params))
}*/
}
}
6 changes: 6 additions & 0 deletions examples/local-simplified-yaml/admin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# gitops-admin

Copy `terraform.template.tfvars` file to `terraform.tfvars` and key in Spectro Cloud credentials and other details.
Make sure all files for project, profile have correct values and then run terraform.

While copying files, just copy files present in this repo.
Loading

0 comments on commit 0709f11

Please sign in to comment.