This solution shows how to get started with monitoring and observability using FSO's Machine Agent and installation of the FSO cluster-agent
on Kubernetes using Terraform. How to:
The main objective is to get started with monitoring your infrastructure by showing an automated way of getting the FSO agent installed, so that you have observability baked into an environment from the onset. We first start with the use case of monitoring virtual machines with follow-on use cases showing how Kubernetes clusters, databases, and applications are brought into the fold to ultimately provide a full-stack view of your operations in real time.
Here is a list of dependencies to make this work in your environment:
kubeconfig
file, ours is named iks-cluster01-kubeconfig.yml
but you can name yours with a name that makes the most sense for you but be sure to change the variable name in main.tf
.secret.tfvars
file with values set for variables mentioned in the lab further down in this README.md filensToMonitor
to ensure you are monitoring valid namespaces you would like to monitor with the Cluster AgentWe purposely did not add credentials and other sensitive information to the repo by including them in the .gitignore
file. As such, if you clone this repo, you must create two files.
secret.tfvars
contains sensitive Terraform variables.variables.yml
is used by Ansible.variables.yml
using the command ansible-vault
command and decrypt it as needed locally. You could take the same approach or leave the file unencrypted if you are confident it will not be shared or inadvertently uploaded to a repo.Here is a list of variables you must include and define for each file.
secret.tfvars
in HCL format (file is in the same directory as the terraform.tfvars
file):
vsphere_vm_firmware = bios
)variables.yml
(written in YAML) file:
Make sure the variable addressed in a terraform var files
secret.tfvar
Terraform keeps sensitive values in a file named secret.tfvar
and, because the values contain sensitive information such as account credentials, it's not posted here so you'll need to make one using your credentials.
Be sure to add
secret.tfvar
to your*.gitignore
file to be sure you don't accidentally expose your credentials if you push your changes back to GitHub or other Git repository.
Variable | Description |
---|---|
controller_url | The URL of your FSO Controller passed as a FQDN and port number. For example: https://example.saas.FSO.com:443 |
controller_account | The account name associated with you FSO Controller. |
controller_username | Your username associated with the FSO Controller. |
controller_password | The password of your username associated with the FSO Controller |
controller_accessKey | The account access key for your FSO Controller. |
Be sure to add
secret.tfvar
to your*.gitignore
file to ensure you don't accidentally expose your credentials if you push your changes back to GitHub or other Git repository.
secret.tfvar
file# FSO controller credentials
controller_url = "https://bit.saas.FSO.com:443"
controller_account = "saas01"
controller_username = "majid"
controller_password = "mypassword"
controller_accessKey = "v11234567"
In this example, Terraform uses the vsphere
provider and a vsphere_virtual_machine
resource to:
After Terraform creates five virtual machines, the Ansible playbook installs and configures:
Each Apache Web Server is configured with a custom (using a Jinja template) index.html
page that displays the hostname.
The same approach is taken with the FSO Machine Agent. In other words, a Jinja template creates a custom file for each containing the hostname.
we used terraform Cloud business for the purpose of this practice. Create a new workspace and connect to github to add the Cisco-FSO-install-agent from github. Next step, all variable needs to be addressed if they are not addressed in variable files or variables set.
You see five virtual machines that are created with static IP addresses in vSphere.
Each Apache server has a custom index.html
file that includes the hostname of the machine.
The five virtual machines appear in the FSO controller, each running an Apache Web Server, and all five appearing in the FSO controller.
Also, you will see information about your Kubernetes clusters reported to the FSO Controller by the Kubernetes Agent. To see the information, log into your FSO Controller and navigate to the Servers Tab and clicking Clusters on the left-most navigation panel.
Click any of the check box available just before the OS
column; then click View Details
to see that the data reported by the Machine Agent to the FSO Controller.
You can see the data that is reported by the Machine Agent on apache-webserver-1
.
Details
.Please visit our repositories for more detail and other projects in automation and programability:
https://github.com/bay-infotech
We are working hard to bring more automation and programmability into community. Please contact us for more detail projects and solutions
Owner
Contributors
Categories
Products
AppDynamicsIntersightProgramming Languages
HCLLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community