{"id":29817068,"url":"https://github.com/harness/smp-installer","last_synced_at":"2025-07-28T20:12:09.202Z","repository":{"id":276194697,"uuid":"927514646","full_name":"harness/smp-installer","owner":"harness","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-11T07:31:17.000Z","size":101,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T08:39:36.622Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harness.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-05T04:42:07.000Z","updated_at":"2025-06-11T07:31:21.000Z","dependencies_parsed_at":"2025-02-06T20:33:34.075Z","dependency_job_id":"47e60356-4bcb-4682-84f0-cdec0852dafc","html_url":"https://github.com/harness/smp-installer","commit_stats":null,"previous_names":["harness/smp-installer"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/harness/smp-installer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harness%2Fsmp-installer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harness%2Fsmp-installer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harness%2Fsmp-installer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harness%2Fsmp-installer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harness","download_url":"https://codeload.github.com/harness/smp-installer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harness%2Fsmp-installer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267578003,"owners_count":24110351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-28T20:12:08.492Z","updated_at":"2025-07-28T20:12:09.192Z","avatar_url":"https://github.com/harness.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# harness-smp-installer\nInstaller for Harness SMP\n\n# Supported Platforms\n- AWS: Supports EKS with ALB\n\n# Supported Profiles\n\n| Profile | Resources          | Description                                     |\n| ------- | ------------------ | ----------------------------------------------- |\n| small   | 5 t2.2xlarge nodes | Supports 50 users with 10 concurrent executions |\n| pov     | 2 t2.2xlarge nodes | Supports 5 users with 1 execution at a time     |\n\n# Supported Features\n\n| Feature            | Description                                         | Supported Platform |\n| ------------------ | --------------------------------------------------- | ------------------ |\n| loadbalancer       | Creates loadbalancer                                | AWS (ALB)          |\n| kubernetes cluster | Creates kubernetes cluster with desired node config | AWS (EKS)          |\n| vpc                | Creates VPC                                         | AWS                |\n| airgap             | Creates egress rules to block outgoing traffic      | AWS                |\n| tls                | Create self signed certificate                      | AWS                |\n| helm chart         | Install harness helm chart with existing overrides  | AWS                |\n| dns                | Create hosted zone for existing domain              | AWS (Route53)      |\n| monitoring         | Install prometheus and grafana helm charts          | AWS (EKS)          |\n\n# Quick Start\n\n## Pre-requisites\n1. Make sure you have `tofu` installed. You can check (official documentation)[https://opentofu.org/docs/intro/install/] on how to install opentofu.\n2. Ensure jq is installed and is in path.\n\n## Run\n1. Clone this repository\n2. Run the binary with the following command\n  ```\n  go build -o smp-installer github.com/harness/smp-installer/cmd\n  ```\n  Note: Any changes to .tf files should follow with build of above binary.\n3. Use the example.yaml as your configuration reference for the tool\n   - Update the necessary fields as required\n5. Authenticate with AWS\n   - Go to AWS IAM Console\n   - Copy the access key and secret key of the user which has admin access to the AWS project\n   - Export the keys in your terminal \n6. Run the sync command\n  `./smp-installer sync -c ./example.yaml`\n7. The tool will generate the output directory configured in `example.yaml` which will store all rendered tofu files.\n\n# Contribute\n\n## File structure\n```\n├── LICENSE\n├── README.md\n├── cmd                                             : contains the entrypoint for the installer\n│   ├── main.go                                     : chains the individual commands\n│   └── resources                                   : contains individual resource command\n│       ├── harness.go\n│       ├── kubernetes.go\n│       ├── loadbalancer.go\n│       └── resource.go\n├── example.yaml                                    : sample file to test the installer\n├── pkg                                             : contains internal logic\n│   ├── client                                      : contains individual resource client. Each client manages the resource creation\n│   │   ├── client.go\n│   │   ├── helm.go\n│   │   ├── kubernetes.go\n│   │   └── loadbalancer.go\n│   ├── render                                      : Contains template logic\n│   │   └── template.go\n│   ├── store                                       : Contains data store to store config and runtime output from clients\n│   │   ├── memory.go\n│   │   ├── memory_test.go\n│   │   └── store.go\n│   └── tofu                                        : Contains tofu files for all supported clouds\n│       ├── aws\n│       │   ├── harness                             : Harness helm chart tofu module\n│       │   │   ├── harness.tf\n│       │   │   ├── tf.vars\n│       │   │   └── variables.tf\n│       │   ├── kubernetes                          : Kubernetes cluster tofu module\n│       │   │   ├── kubernetes.tf\n│       │   │   ├── tf.vars\n│       │   │   ├── variables.tf\n│       │   │   └── vpc.tf\n│       │   └── loadbalancer                        : Load balancer tofu module\n│       │       ├── loadbalancer.tf\n│       │       ├── tf.vars\n│       │       └── variables.tf\n│       ├── files.go                                : Utility to load above files\n│       └── helper.go                               : Tofu helper methods\n├── profiles                                        : Contains supported profile overrides\n│   ├── files.go\n│   └── small\n│       └── override.yaml\n│       └── config.yaml\n│   └── pov\n│       └── override.yaml\n│       └── config.yaml\n```\n\n## Adding new resource\nAdding a new resource requires changes atleast in 3 below places\n- cmd/resources/\u003cnewresource\u003e.go\n- pkg/client/\u003cnewresource\u003e.go\n- pkg/tofu/aws/\u003cnewresource\u003e/*\n\n### Adding resource command\nAdding a new resource command requires a new file at `cmd/resources/\u003cnewresource\u003e.go`.\n\nThe new command type must implement the `Resource` interface and implement the below two methods.\n- `Name()`: This method returns the name of the resource\n- `Sync()`: This method orchestrates the resource lifecylce using resource client\n\n### Adding resource client\nAdding a new resource client requires a new file at `pkg/client/\u003cnewresource\u003e.go`\n\nThe new client must implement the `Client` interface and implement the below methods.\n- `PreExec()`: This method is invoked to prepare the environment before invoking `tofu`. This can be used to change values in some file, add data for `.Self` object to be used for rendering etc.\n- `Exec()`: This method is called to invoke the tofu command. Client can use this method to check for existing tofu state, invoke tofu command, or run some other operations.\n- `PostExec()`: This method is called to do cleanups. This method is expected to return the output for this resource which is used to populate the `.Output` object\n\n### Adding tofu module\nAdding a new tofu module requires adding the module at `pkg/tofu/\u003ccloud\u003e/\u003cnewresource\u003e`. The tofu module must have tofu files and a var file named `tf.vars` which is either templatized or hardcoded.\n\n## Templates\nAll tofu files and profile overrides can be templated. \n\nInstaller provides below built-in objects to be used in the templates.\n\n1. `.Config`: This object can be used to refer to values coming from installer's config file such as example.yaml.\n            \n            Example: {{ .Config.kubernetes.version }}\n2. `.Ouput`: This object can be used to refer to output exposed by any resource client. For example, profile override can refer to loadbalancer IP like `.Output.loadbalancer.ip` if loadbalancer client exposes the output.\n3. `.Self`: This object can be used to refer to data exposed by a client during its `PreExec` hook.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharness%2Fsmp-installer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharness%2Fsmp-installer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharness%2Fsmp-installer/lists"}