This page provides detailed, step-by-step instructions on how to install the MicroK8s agent within a custom namespace.

Step 1: Prepare Your Environment

  • Make sure you have access to a Kubernetes cluster.
  • Ensure you have the necessary permissions to create namespaces and deploy resources within them.

Step 2: Create a Custom Namespace

  1. Use the following command to create a new namespace.

microk8s kubectl create ns {namespace-name}
For example- microk8s kubectl create ns monitoring

Step 3: Install the Microk8s Integration

If you have already installed Microk8s integration, skip this step and proceed to the 4th step below. Otherwise, refer to the document for installing the Microk8s integration.

Step 4: Configure the Integration

  1. Create a YAML file within your cluster. Name it agent.yaml.
  2. Paste the configuration content copied from the portal into the agent.yaml file.
  3. Replace all instances of namespace: OpsRamp-agent with the name of the newly created namespace.
  4. If the namespace already exists, remove the section in the YAML file responsible for creating the namespace.Example of the edited YAML file:
    apiVersion: v1
    kind: Namespace
    metadata:
      name: monitoring
    
    ---
    # Your other configurations here with namespace replaced
    kubernetes
  5. Following is the example of the ServiceAccount namespace:
    • ServiceAccount
    • ClusterRoleBinding
    • DaemonSet
    • Deployment
    • ConfigMap in OpsRamp Agent YAML
  6. Apply the edited configuration using the following command.
    microk8s kubectl apply -f agent.yaml 
  7. Verify the installation status of the agent within the namespace by running the following command.
    microk8s kubectl get pods -n monitoring 

Step 5: Check the Status of Namespace in OpsRamp

  1. Navigate to Infrastructure > Resources.
  2. In the left side of the page, click Kubernetes to expand it.
  3. Expand the Nodes and click Container.
  4. Under Attributes, you can view the status of your newly created namespace.
    Azure Blob Storage Integration

OpsRamp Agent yaml

Default yaml we get from portalChanges that are to be done to install in a different namespace
apiVersion: v1
kind: ServiceAccount
metadata:
  name: opsrampagent
  namespace: opsramp-agent
automountServiceAccountToken: true
    apiVersion: v1
    kind: ServiceAccount
    metadata:
     name: opsrampagent
     namespace: monitoring
    automountServiceAccountToken: true