Agents
The repo agent is a service you deploy and operate in your local network or VPC so that the Controller can securely connect to your your artifact repositories.
The table below describes the list of actions that can be performed on "repository" using the RCTL CLI Utility.
Resource | Create | Get | Delete |
---|---|---|---|
Agent | YES | YES | YES |
Create Agent¶
Both "imperative" and "declarative" approaches are supported for management of agents.
Imperative¶
You can create an agent in the dev-cluster using the command shown below.
./rctl create agent sample-agent --type ClusterAgent --cluster-name dev-cluster
Declarative¶
You can also create an agent in the controller based on a version controlled agent spec that you can store in a Git repository. This enables users to develop automation for reproducible infrastructure.
./rctl create agent -f dev-cluster-agent.yaml
An illustrative example of the agent spec YAML file is shown below
kind: Agent
apiVersion: config.rafay.dev/v2
metadata:
name: agent-name
project: sample-project
spec:
template:
type: ClusterAgent
clusterName: dev-cluster
List Agents¶
Use this command to retrieve the list of agents in the configured Project. The name of the agents, the type of agent and health status are returned. An illustrative example is shown below where RCTL retrieves the list of agents in the project "Demo".
./rctl get agent --project Demo
+---------------+--------------+---------------+------------------------------+
| AGENT NAME | TYPE | HEALTH STATUS | CREATE AT |
+---------------+--------------+---------------+------------------------------+
| dev | ClusterAgent | HEALTHY | Thu Jan 7 22:37:16 UTC 2021 |
+---------------+--------------+---------------+------------------------------+
| test | ClusterAgent | HEALTHY | Sat Mar 6 08:31:48 UTC 2021 |
+---------------+--------------+---------------+------------------------------+
| demo | ClusterAgent | HEALTHY | Sat Mar 6 09:00:56 UTC 2021 |
+---------------+--------------+---------------+------------------------------+
Get Specific Agent Info¶
Use this command to retrieve a specific agent's details in the configured project.
./rctl get agent <agent-name>
Below is the illustrative example for the agent called "demo"
./rctl get agent demo
+---------------+--------------+---------------+------------------------------+
| AGENT NAME | TYPE | HEALTH STATUS | CREATE AT |
+---------------+--------------+---------------+------------------------------+
| demo | ClusterAgent | HEALTHY | Sat Mar 6 09:00:56 UTC 2021 |
+---------------+--------------+---------------+------------------------------+
Or you can use below command to get more information of the agent in json or yaml format
./rctl get agent <agent-name> -o json
./rctl get agent <agent-name> -o yaml
Delete Agent¶
You can delete an agent in the configured project.
./rctl delete agent <agent-name>