diff --git a/examples/edge/config/cluster/cluster-edge-dev.yaml b/examples/edge/config/cluster/cluster-edge-dev.yaml index e2f0837..a8f112f 100644 --- a/examples/edge/config/cluster/cluster-edge-dev.yaml +++ b/examples/edge/config/cluster/cluster-edge-dev.yaml @@ -6,18 +6,65 @@ profiles: name: withoutcreds-full cloud_config: ssh_key: spectro2022 + +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 control_plane_as_worker: true count: 1 placements: - - appliance: "edge-mar-6" + - appliance: "edge-apr-5" - name: worker-pool count: 1 placements: - - appliance: "edge-mar-6" + - appliance: "edge-apr-5" + + additional_labels: + #name: "worker" + addlabel: "addlabelval1" + + + taints: + - key: "taintkey1" + value: "taintvalue1" + effect: "PreferNoSchedule" + - key: "taintkey2" + value: "taintvalue2" + effect: "NoSchedule" scan_policy: configuration_scan_schedule: "0 0 * * SUN" diff --git a/examples/edge/config/profile/profile-withoutcreds-full.yaml b/examples/edge/config/profile/profile-withoutcreds-full.yaml index 0e0632b..f8f5b5a 100644 --- a/examples/edge/config/profile/profile-withoutcreds-full.yaml +++ b/examples/edge/config/profile/profile-withoutcreds-full.yaml @@ -158,10 +158,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: diff --git a/examples/libvirt/config/cluster/cluster-libvirt-dev.yaml b/examples/libvirt/config/cluster/cluster-libvirt-dev.yaml index 376b182..b0dcc99 100644 --- a/examples/libvirt/config/cluster/cluster-libvirt-dev.yaml +++ b/examples/libvirt/config/cluster/cluster-libvirt-dev.yaml @@ -60,7 +60,6 @@ node_groups: - 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" @@ -80,7 +79,6 @@ node_groups: - 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" diff --git a/spectro-appliance.tf b/spectro-appliance.tf index 9b3d9b1..6f5a48c 100644 --- a/spectro-appliance.tf +++ b/spectro-appliance.tf @@ -9,9 +9,6 @@ locals { all_appliance_uids = setsubtract(local.cluster_appliance_uids, [""]) } -output "cluster_appliance_uids" { - value = local.all_appliance_uids -} data "spectrocloud_appliance" "this" { for_each = local.all_appliance_uids diff --git a/spectro-cluster-edge-vsphere.tf b/spectro-cluster-edge-vsphere.tf index 6e651d2..a6b11d3 100644 --- a/spectro-cluster-edge-vsphere.tf +++ b/spectro-cluster-edge-vsphere.tf @@ -56,6 +56,7 @@ resource "spectrocloud_cluster_edge_vsphere" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", each.value.profiles.infra.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.infra-pack-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.infra.name, pack.value.name)] : local.infra-pack-template-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.infra.name, pack.value.name)]) @@ -81,6 +82,7 @@ resource "spectrocloud_cluster_edge_vsphere" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", each.value.profiles.system.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.infra-pack-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.system.name, pack.value.name)] : local.infra-pack-template-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.system.name, pack.value.name)]) @@ -109,6 +111,7 @@ resource "spectrocloud_cluster_edge_vsphere" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", cluster_profile.value.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.addon_pack_params_replaced[format("%s-%s-%s", each.value.name, cluster_profile.value.name, pack.value.name)] : local.addon_pack_template_params_replaced[format("%s-%s-%s", each.value.name, cluster_profile.value.name, pack.value.name)]) diff --git a/spectro-cluster-edge.tf b/spectro-cluster-edge.tf index 408332d..69b8033 100644 --- a/spectro-cluster-edge.tf +++ b/spectro-cluster-edge.tf @@ -50,6 +50,7 @@ resource "spectrocloud_cluster_edge" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", each.value.profiles.infra.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.infra-pack-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.infra.name, pack.value.name)] : local.infra-pack-template-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.infra.name, pack.value.name)]) @@ -75,6 +76,7 @@ resource "spectrocloud_cluster_edge" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", each.value.profiles.system.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.infra-pack-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.system.name, pack.value.name)] : local.infra-pack-template-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.system.name, pack.value.name)]) @@ -103,6 +105,7 @@ resource "spectrocloud_cluster_edge" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", cluster_profile.value.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.addon_pack_params_replaced[format("%s-%s-%s", each.value.name, cluster_profile.value.name, pack.value.name)] : local.addon_pack_template_params_replaced[format("%s-%s-%s", each.value.name, cluster_profile.value.name, pack.value.name)]) diff --git a/spectro-cluster-eks.tf b/spectro-cluster-eks.tf index cf6d83c..99ebdde 100644 --- a/spectro-cluster-eks.tf +++ b/spectro-cluster-eks.tf @@ -11,6 +11,7 @@ resource "spectrocloud_cluster_eks" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", each.value.profiles.infra.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.infra-pack-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.infra.name, pack.value.name)] : local.infra-pack-template-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.infra.name, pack.value.name)]) @@ -36,6 +37,7 @@ resource "spectrocloud_cluster_eks" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", cluster_profile.value.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.addon_pack_params_replaced[format("%s-%s-%s", each.value.name, cluster_profile.value.name, pack.value.name)] : local.addon_pack_template_params_replaced[format("%s-%s-%s", each.value.name, cluster_profile.value.name, pack.value.name)]) diff --git a/spectro-cluster-libvirt.tf b/spectro-cluster-libvirt.tf index 0a3dc2a..8cea05d 100644 --- a/spectro-cluster-libvirt.tf +++ b/spectro-cluster-libvirt.tf @@ -52,6 +52,7 @@ resource "spectrocloud_cluster_libvirt" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", each.value.profiles.infra.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.infra-pack-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.infra.name, pack.value.name)] : local.infra-pack-template-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.infra.name, pack.value.name)]) @@ -77,6 +78,7 @@ resource "spectrocloud_cluster_libvirt" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", each.value.profiles.system.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.infra-pack-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.system.name, pack.value.name)] : local.infra-pack-template-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.system.name, pack.value.name)]) @@ -105,6 +107,7 @@ resource "spectrocloud_cluster_libvirt" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", cluster_profile.value.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.addon_pack_params_replaced[format("%s-%s-%s", each.value.name, cluster_profile.value.name, pack.value.name)] : local.addon_pack_template_params_replaced[format("%s-%s-%s", each.value.name, cluster_profile.value.name, pack.value.name)]) @@ -151,7 +154,7 @@ resource "spectrocloud_cluster_libvirt" "this" { image_storage_pool = placements.value.image_storage_pool target_storage_pool = placements.value.target_storage_pool data_storage_pool = placements.value.data_storage_pool - network = placements.value.network + network = try(placements.value.network, "") } } diff --git a/spectro-cluster-tke.tf b/spectro-cluster-tke.tf index 966b81a..50269b2 100644 --- a/spectro-cluster-tke.tf +++ b/spectro-cluster-tke.tf @@ -11,6 +11,7 @@ resource "spectrocloud_cluster_tke" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", each.value.profiles.infra.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.infra-pack-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.infra.name, pack.value.name)] : local.infra-pack-template-params-replaced[format("%s-%s-%s", each.value.name, each.value.profiles.infra.name, pack.value.name)]) @@ -36,6 +37,7 @@ resource "spectrocloud_cluster_tke" "this" { content { name = pack.value.name tag = try(pack.value.version, "") + registry_uid = try(local.all_registry_map[pack.value.registry][0], "") type = (try(pack.value.is_manifest_pack, false)) ? "manifest" : "spectro" values = (try(pack.value.is_manifest_pack, false)) ? local.cluster-profile-pack-map[format("%s-%s", cluster_profile.value.name, pack.value.name)].values : (pack.value.override_type == "values") ? pack.value.values : (pack.value.override_type == "params" ? local.addon_pack_params_replaced[format("%s-%s-%s", each.value.name, cluster_profile.value.name, pack.value.name)] : local.addon_pack_template_params_replaced[format("%s-%s-%s", each.value.name, cluster_profile.value.name, pack.value.name)]) @@ -101,6 +103,8 @@ resource "spectrocloud_cluster_tke" "this" { content { name = machine_pool.value.name count = machine_pool.value.count + min = try(machine_pool.value.min, "") + max = try(machine_pool.value.max, "") instance_type = machine_pool.value.instance_type az_subnets = machine_pool.value.worker_subnets disk_size_gb = machine_pool.value.disk_size_gb