copyright | lastupdated | keywords | subcollection | ||
---|---|---|---|---|---|
|
2025-01-20 |
schematics agents, agents, set up an agent |
schematics |
{{site.data.keyword.attribute-definition-list}}
{: #agent-infrastructure-overview}
Agents for {{site.data.keyword.bplong}} extend its ability to work directly to cloud infrastructure on the private network or in any isolated network zones. {: shortdesc}
{: #agents-setup-prereq}
The following prerequisites must be met before you begin deploying the agent infrastructure.
- You must have an {{site.data.keyword.cloud_notm}} Pay-As-You-Go or Subscription{: external} account to proceed. For more information about managing your {{site.data.keyword.cloud_notm}}, see Setting up your {{site.data.keyword.cloud_notm}} account.
- Check whether you have the permissions to provision a VPC, a {{site.data.keyword.containerlong_notm}} cluster, and logging service in the target resource group.
- Check whether you have the permission to create a workspace.
{: #agents-infra-workspace}
{{site.data.keyword.bpshort}} provides a sample template{: external} that you can use to provision the infrastructure needed by your agent. The Agent infrastructure is composed of the following resources.
-
VPC infrastructure as
public_gateways
,subnets
. -
{{site.data.keyword.containerlong}} or {{site.data.keyword.redhat_openshift_notm}} {{site.data.keyword.containershort_notm}} as
vpc_kubernetes_cluster
.To support agents on the {{site.data.keyword.redhat_openshift_notm}} {{site.data.keyword.containershort_notm}}, based on the requirement, you can control egress traffic through Security Groups and Network access control lists (ACLs). You need to define any {{site.data.keyword.networksecuritygroups_short}} rules and ACLs at VPC level before deploying an agent on the cluster. For more information, see Terraform script to define security groups and ACLs on VPC{: external}. {: note}
-
Log in to {{site.data.keyword.cloud_notm}} console{: external}.
-
Click the Menu icon
> Platform Automation > Schematics > Terraform > Create workspace{: external} with the following inputs to create an Agent infrastructure workspace.
- In the Specify Template section:
GitHub
,GitLab
, orBitbucket
repository URL -https://github.com/Cloud-Schematics/agent-infrastructure-sample/tree/main/templates/infrastructure
.- Personal access token -
<leave it blank>
. You can click theOpen reference picker
to select a your {{site.data.keyword.secrets-manager_short}} key reference. For more information, see creating a {{site.data.keyword.secrets-manager_short}} instance. - Terraform Version -
terraform_v1.5
. You need to select Terraform version 1.5 or greater than version. - Click
Next
.
- In the Workspace details section:
-
Workspace name as
schematics-agent-infrastructure
. -
Tags as
agents-infra
. -
Resource group as
default
or other resource group for this workspace. For more information, see Creating a resource group. You must have the access permission for the resource group. -
Location as
North America
or other region for this workspace. If the location used for Agent infrastructure and Agent service does not match, then the logs are not sent to LogDNA. {: note} -
Click
Next
. -
Check the information that is entered are correct to create a workspace.
-
- Click
Create
.
- In the Specify Template section:
-
On successful creation of the
schematics-agent-infrastructure
Workspace, review and edit theagent infrastructure
input variables in the workspace Settings page.The agent infrastructure and the workspace can be in different resource groups and locations. The agent infrastructure workspace can be defined in any {{site.data.keyword.bpshort}} supported region. {: note}
Input variable Data type Required/Optional Description agent_prefix
String Required
Provide the prefix for naming your agent VPC, cluster, and logging configuration. location
String Required
The region in the agent infrastructure VPC and cluster are created in. resource_group_name
String Required
Name for the resource group used the agent infrastructure and agent are associated to. For example, test_agent
. For more information, see Creating a resource group. You must have the access permission for the resource group.ibmcloud_api_key
String Optional
The {{site.data.keyword.cloud_notm}} API key used to provision the {{site.data.keyword.bpshort}} Agent infrastructure resources. If not provided, resources provisions in currently logged in user credentials. tags
List(String) Optional
A list of user tags to be applied to the deployed, VPC, and cluster. For example, myproject:agent
,test:agentinfra
. You can see the provisioned resources of an Agent faster by using Tag name.{: caption="{{site.data.keyword.bpshort}} Agent infrastructure inputs" caption-side="bottom"} -
Click Apply plan on the
schematics-agent-infrastructure
workspace to provision the agent infrastructure. It takes up to 45 - 90 minutes to provision all the resources. -
View the Jobs logs and Resources page to monitor the resources are provisioned successfully and verify that the workspace status is now
ACTIVE
.Record the
cluster_id
andlogdna_name
from theOutputs:
section of the Jobs log. This information is used when deploying the agent. If the job fails and you do not observe thecluster_id
details in the Jobs log, you must have the IAM permissions to createVPC Infrastructure
, andKubernetes cluster
services. Then, click Apply plan to redeploy the agent infrastructure. {: important}
{: #agents-setup-infra-output}
Follow the steps to view the Agent infrastructure workspace setup.
-
Navigate to the Resources list{: external} page.
-
Verify that the following resources are provisioned from the resource list page.
- VPC > Search
<agent_prefix>-vpc
the status as Available. - Services and Software >
<agent_prefix>-logdna
the status as Active. - Clusters >
<agent_prefix>-iks
the status as Normal.
Optional, you can search the provisioned resources with the user tag you specified in the Resources list{: external} page. {: note}
- VPC > Search
{: #nextsteps-agent-infra}
You have completed the {{site.data.keyword.bpshort}} Agent infrastructure set up.
- Now, you need to Deploy your Agent