Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli-helper and remove templates zip #36

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ This repository has `.tf` configuration for the deployment of Agent infrastructu

## Using tar files

The respository contains the solution templates in the form of `tar` files to install the `Agent infrastructure` and deploy the `Agent service`. Perform following steps to use the `tar` file.
The release contains the solution templates in the form of `tar` files to install the `Agent infrastructure` and deploy the `Agent service`. Perform following steps to use the `tar` file.

- Download the `/templates/templates.zip` file to your local system.
- From your terminal extract the content of `zip` file using the command. `unzip templates.zip`
- Download the schematics-agents release to your local system.
- From your terminal extract the content of `schematics-agents.tgz`
- The templates as TAR files should now be available as
- The `agent-infrastructure-templates.tar` for setting up the VPC, IKS cluster, and LogDNA services infrastructure.
- The `agent-service-templates.tar` to deploy the Agent service into your infrastructure.
- The `agent-service-templates.tar` to deploy the Agent service into your infrastructure.

## Infrastructure

Expand All @@ -76,17 +76,14 @@ Click [here](https://cloud.ibm.com/docs/schematics?topic=schematics-agents-setup
| ---------- | -------- | -------------- | ---------- | ----------- | ----------- |
| agent_prefix | You will use this prefix, for `vpc`, `cluster`, and `observability`. (Maximum length 27 chars) | | | my-project | |
| location | Location of the Agent infrastructure. Note: For Beta, the Agent must be deployed in a freshly provisioned `VPC`, `IKS Cluster`, `Log Analysis` instances. | | | `us-south` | |
| resource_group_name | Name of resource group used where Agent infrastructure was provisioned. | string | ✓ | | |
| tags | A list of tags for the Agent infrastructure | list(string) | | my-project:agent | |
| ibmcloud_api_key | The IBM Cloud API Key used to provision the schematics Agent infrastructure resources. If not provided, then resources will be provisioned in currently logged in user account. | string | | | ✓ |
| agent_name | Name of the agent. | string | | my-project | |
| location| Location of the agent services. It must be the same as the agent infrastructure/cluster location. | string | | us-south | |
| resource_group_name | Name of resource group used where agent infrastructure was provisioned. | string | ✓ | | |
| profile_id | The IBM Cloud IAM Trusted Profile ID which provides authorization for agents to process jobs. More info can be found [here](https://cloud.ibm.com/docs/account?topic=account-create-trusted-profile&interface=ui) | string | ✓ | | ✓ |
| schematics_endpoint_location | Location of the schematics endpoint. This location is used to connect your agent with schematics service. The valid locations are us/eu/us-south/us-east/eu-de/eu-gb | string | | `us-south` | |
| cluster_id | ID of the cluster used to run the agent service. | string | ✓ | | |
| logdna_name | Name of the IBM Log Analysis service instance, used to send the agent logs. | string | ✓ | | |
| ibmcloud_api_key | The IBM Cloud API Key used to deploy the schematics agent resources. If not provided, resources will be deployed using the logged in user credentials. | string | | | ✓ |

## Outputs

Expand Down
57 changes: 57 additions & 0 deletions cli-helper/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# schematics-agents-CLI

Use ibmcloud schematics CLI to create workspace and upload agent tar files.

## Create Agent Infrastructure Workspace

Use create_agent_infra_workspace.json with ibmcloud schematics cli to create workspace for infrastructure. Edit the json to update the inputs.

#### Inputs

| name | description | type | required | default | sensitive |
| ---------- | -------- | -------------- | ---------- | ----------- | ----------- |
| agent_prefix | You will use this prefix, for `vpc`, `cluster`, and `observability`. (Maximum length 27 chars) | | | my-project | |
| location | Location of the Agent infrastructure. Note: For Beta, the Agent must be deployed in a freshly provisioned `VPC`, `IKS Cluster`, `Log Analysis` instances. | | | `us-south` | |
| resource_group_name | Name of resource group used where Agent infrastructure was provisioned. | string | ✓ | | |
| tags | A list of tags for the Agent infrastructure | list(string) | | my-project:agent | |

#### Example

```
ibmcloud schematics workspace create new --file create_agent_infra_workspace.json
```

## Create Agent Services Workspace

Use create_agent_service_workspace.json with ibmcloud schematics cli to deploy services on the provisioned Agent Infrastructure. Edit the json to update the inputs.

| name | description | type | required | default | sensitive |
| ---------- | -------- | -------------- | ---------- | ----------- | ----------- |
| ibmcloud_api_key | The IBM Cloud API Key used to provision the schematics Agent infrastructure resources. If not provided, then resources will be provisioned in currently logged in user account. | string | | | ✓ |
| agent_name | Name of the agent. | string | | my-project | |
| location| Location of the agent services. It must be the same as the agent infrastructure/cluster location. | string | | us-south | |
| resource_group_name | Name of resource group used where agent infrastructure was provisioned. | string | ✓ | | |
| profile_id | The IBM Cloud IAM Trusted Profile ID which provides authorization for agents to process jobs. More info can be found [here](https://cloud.ibm.com/docs/account?topic=account-create-trusted-profile&interface=ui) | string | ✓ | | ✓ |
| schematics_endpoint_location | Location of the schematics endpoint. This location is used to connect your agent with schematics service. The valid locations are us/eu/us-south/us-east/eu-de/eu-gb | string | | `us-south` | |
| cluster_id | ID of the cluster used to run the agent service. | string | ✓ | | |
| logdna_name | Name of the IBM Log Analysis service instance, used to send the agent logs. | string | ✓ | | |


#### Example

```
ibmcloud schematics workspace create new --file create_agent_service_workspace.json
```

## Next Steps

Download the schematics-agents release to your local system.
- From your terminal extract the schematics-agents.tgz
- The templates as TAR files should now be available as
- The `agent-infrastructure-templates.tar` for setting up the VPC, IKS cluster, and LogDNA services infrastructure.
- The `agent-service-templates.tar` to deploy the Agent service into your infrastructure.
- Use ibmcloud schematics cli to upload the tar files to respective workspace
```
ex:
ibmcloud schematics workspace upload --id us-east.workspace.schematics-remote-service-workspace.f3c5bfe2 --file ./agent-service-templates.tar -tid 9bfe4530-cfb2-41
```
13 changes: 0 additions & 13 deletions tarfiles/Readme.md

This file was deleted.

Binary file removed tarfiles/templates.zip
Binary file not shown.
4 changes: 4 additions & 0 deletions templates/service/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ locals {
schematics_jobrunner_image = "icr.io/schematics-remote/schematics-job-runner:eb8ca280-179"
#Schematics agent job12 image ID
schematics_runtime_job_image = "icr.io/schematics-remote/schematics-agent-ws-job-20220704:60824f4e-276"
#Schematics agent ansible image ID
schematics_runtime_ansible_job_image = "us.icr.io/schematics/schematics-ansible-job:b164f614-171"
#Schematics agent adapter image ID
schematics_runtime_adapter_job_image = "us.icr.io/schematics/schematics-data-adapter:48537ed2-62"
#schematics_sandbox_image
schematics_sandbox_image = "icr.io/schematics-remote/schematics-sandbox:9bdc3645-283"
#Schematics environment (dev|stage|prod)
Expand Down
Loading