diff --git a/examples/config/cluster/cluster-eks-dev-2.yaml b/examples/config/cluster/cluster-eks-dev-2.yaml deleted file mode 100644 index 95ceca1..0000000 --- a/examples/config/cluster/cluster-eks-dev-2.yaml +++ /dev/null @@ -1,111 +0,0 @@ -name: eks-dev -cloud_account: dev-030 -profiles: - infra: - name: EKS-Base-1 - packs: - - name: kubernetes-eks - version: 1.20 - override_type: params #[values, params, template] - params: - OIDC_IDENTITY_PROVIDER_NAME: eks-oidc # parameter value in cluster profile pack values should be "%OIDC_IDENTITY_PROVIDER_NAME%" - OIDC_CLAIM_NAME: oidc-custom-claim # parameter value in cluster profile pack values should be "%OIDC_CLAIM_NAME%" - OIDC_ISSUER_URL: https://123456-okta.com/111111/hello # parameter value in cluster profile pack values should be "%OIDC_ISSUER_URL%" - - name: sapp-hipster - version: "2.0.0" - override_type: params #[values, params, template] - params: - HIPSTER_NAMESPACE: "hipster-cluster" # parameter value in cluster profile pack values should be "%HIPSTER_NAMESPACE%" - - name: spectro-byo-manifest - version: 1.0.0 - override_type: values #[values, params, template] - values: | # complete value will be overriden at cluster level - manifests: - byo-manifest: - contents: | - apiVersion: apps/v1 - kind: Deployment - metadata: - name: nginx-deployment - labels: - app: nginx - spec: - replicas: 3 - selector: - matchLabels: - app: nginx - template: - metadata: - labels: - app: nginx - spec: - containers: - - name: nginx - image: nginx:1.14.2 - ports: - - containerPort: 80 - - name: profile-installation - is_manifest_pack: true - manifest_name: profile-install-crd - override_type: template - params: # cluster profile pack value/manifest content will be repeated as many times map of params is specified - - NAMESPACE_NAME: namespace-cluster-10 - NAMESPACE_LABEL_KEY: app - NAMESPACE_LABEL_VALUE: cluster1 - - NAMESPACE_NAME: namespace-cluster-2 - NAMESPACE_LABEL_KEY: app - NAMESPACE_LABEL_VALUE: cluster2 - addons: - - name: addon-profile-1 - - name: addon-profile-2 - packs: - - name: nginx - version: 0.43.0 - override_type: params #[values, params, template] - params: - NGINX_NAME_OVERRIDE: nginx-ingress - NGINX_REPO_IMAGE: k8s.gcr.io/ingress-nginx/controller - - name: profile-install - is_manifest_pack: true - manifest_name: profile-install-crd - override_type: template - params: # cluster profile pack value/manifest content will be repeated as many times map of params is specified - - NAMESPACE_NAME: namespace-cluster-10 - NAMESPACE_LABEL_KEY: app - NAMESPACE_LABEL_VALUE: cluster1 - - NAMESPACE_NAME: namespace-cluster-2 - NAMESPACE_LABEL_KEY: app - NAMESPACE_LABEL_VALUE: cluster2 -cloud_config: - aws_region: us-east-1 - aws_vpc_id: vpc-0bf456fc3c75abbbe - endpoint_access: private - eks_subnets: - us-east-1a: subnet-0931c5e4f5d4ba6d3,subnet-0c494a1ab5916ac3c - us-east-1b: subnet-022297ad4023c0f29,subnet-0a75634ca4c15df8f -node_groups: - - name: worker-basic - count: 3 - disk_size_gb: 61 - instance_type: t3.large - worker_subnets: - us-east-1a: subnet-0dac5b9c4d3ff0d5c - us-east-1b: subnet-0d710ba055593d68b -fargate_profiles: - - name: fg-1 - subnets: - - subnet-0dac5b9c4d3ff0d5c - - subnet-0d710ba055593d68b - additional_tags: {hello: test1} - selectors: - - namespace: fargate - labels: - abc: cool -backup_policy: - schedule: "0 0 * * SUN" - backup_location: qa-sharma - prefix: weekly -scan_policy: - configuration_scan_schedule: "0 0 * * SUN" - penetration_scan_schedule: "0 0 * * SUN" - conformance_scan_schedule: "0 0 1 * *" \ No newline at end of file diff --git a/examples/config/cluster/cluster-eks-dev.yaml b/examples/config/cluster/cluster-eks-dev.yaml index 76cb726..5b79648 100644 --- a/examples/config/cluster/cluster-eks-dev.yaml +++ b/examples/config/cluster/cluster-eks-dev.yaml @@ -5,7 +5,7 @@ profiles: name: EKS-Base packs: - name: kubernetes-eks - version: 1.20 + version: "1.20" override_type: params #[values, params, template] params: OIDC_IDENTITY_PROVIDER_NAME: eks-oidc # parameter value in cluster profile pack values should be "%OIDC_IDENTITY_PROVIDER_NAME%" @@ -39,17 +39,15 @@ profiles: image: nginx:1.14.2 ports: - containerPort: 80 - - name: profile-installation + - name: install-application is_manifest_pack: true - manifest_name: profile-install-crd + manifest_name: install-app-crd override_type: template params: # cluster profile pack value/manifest content will be repeated as many times map of params is specified - - NAMESPACE_NAME: namespace-cluster-10 - NAMESPACE_LABEL_KEY: app - NAMESPACE_LABEL_VALUE: cluster1 - - NAMESPACE_NAME: namespace-cluster-2 - NAMESPACE_LABEL_KEY: app - NAMESPACE_LABEL_VALUE: cluster2 + - PROFILE_NAME: small-app + PROFILE_SPEC_NAME: small-app + - PROFILE_NAME: security-app + PROFILE_SPEC_NAME: security-app addons: - name: profile_addon cloud_config: diff --git a/examples/config/profile/profile-infra.yaml b/examples/config/profile/profile-infra.yaml index 68fe777..8f555b5 100644 --- a/examples/config/profile/profile-infra.yaml +++ b/examples/config/profile/profile-infra.yaml @@ -294,13 +294,10 @@ packs: manifests: - name: install-app-crd content: | - apiVersion: v1 - kind: Namespace + apiVersion: ehl.ees/v1 + kind: ProfileInstallation metadata: - name: sc-system - - name: install-app-config - content: | - apiVersion: v1 - kind: Namespace - metadata: - name: sc-system-config \ No newline at end of file + name: "%PROFILE_NAME%" + spec: + name: "%PROFILE_SPEC_NAME%" + --- diff --git a/examples/mod_spectro_org.tf b/examples/mod_spectro_org.tf index deadf78..74c428b 100644 --- a/examples/mod_spectro_org.tf +++ b/examples/mod_spectro_org.tf @@ -7,7 +7,7 @@ locals { accounts_params = { ACCOUNT_DEV_NAME = "ehs-dev-030", ACCOUNT_PROD_NAME = "ehs-stg-004" } - bsl_params = { BSL_NAME = "qa-sharma" } + bsl_params = { BSL_NAME = "qa-sharma" } profile_params = { SPECTRO_REPO_URL = "https://registry.spectrocloud.com", @@ -30,11 +30,11 @@ locals { } module "SpectroOrg" { - source = "github.com/spectrocloud/terraform-spectrocloud-modules" - sc_host = "" #e.g: api.spectrocloud.com (for SaaS) - sc_username = "" #e.g: user1@abc.com - sc_password = "" #e.g: supereSecure1! - sc_project_name = "" #e.g: Default + source = "../" + sc_host = "api.stage.spectrocloud.com" #e.g: api.spectrocloud.com (for SaaS) + sc_username = "nikolay+demo@spectrocloud.com" #e.g: user1@abc.com + sc_password = "welcome2Spectr0!1" #e.g: supereSecure1! + sc_project_name = "Default" #e.g: Default /*accounts = tomap({ for k, v in module.fetcher_accounts.object_files : @@ -53,7 +53,7 @@ module "SpectroOrg" { profiles = { for k in fileset("config/profile", "profile-*.yaml") : - trimsuffix(k, ".yaml") => yamldecode(templatefile("config/profile/${k}", local.profile_params)) + trimsuffix(k, ".yaml") => yamldecode(templatefile("config/profile/${k}", local.profile_params)) } projects ={ @@ -66,10 +66,8 @@ module "SpectroOrg" { trimsuffix(k, ".yaml") => yamldecode(templatefile("config/project/${k}", {})) } - /*clusters = tomap({ - for k, v in toset([ - "cluster-eks-test.yaml", - ]) : - k => yamldecode(file(join("", [local.clusters_folder, "/${k}"]))) - })*/ + clusters = { + for k in fileset("config/cluster", "team-*.yaml") : + trimsuffix(k, ".yaml") => yamldecode(templatefile("config/project/${k}", {})) + } } \ No newline at end of file