Komiser Documentation

repository·develop·Indexed 26 days ago

https://github.com/mlabouardy/komiser

An open-source, cloud-agnostic resource manager for analyzing and managing cloud costs, usage, security, and governance across providers including AWS, Azure, GCP, Kubernetes, Digital Ocean, and others. Includes documentation for the Komiser CLI, server configuration, and the Next.js dashboard development environment.

Tokens
16.3K
Snippets
72
Records
117
Agent score
87%

What's inside Komiser

  1. Overview of the Komiser Dashboard

    develop

    The Komiser Dashboard provides a centralized overview of your cloud environments by collecting and summarizing cloud resources across different accounts, regions, and providers.

    Key features include:

    • Top Widgets: Displays connected cloud accounts, resource locations (regions), total resource counts, and total infrastructure costs.
    • Cloud Map: A geographical visualization of your resources. Hovering over regional data centers provides specific details on resource deployment per region.
    • Resource Manager: Located to the left of the cloud map, this tool allows you to filter resources by cloud accounts, providers, services, and regions, with a pie chart visualization.
    • Cost Explorer: Located below the map, this allows you to sort resources and compare costs on a monthly to yearly basis, with the ability to exclude specific resources from comparisons.
  2. Overview of Komiser

    develop

    Komiser is an open-source, cloud-agnostic resource manager designed to analyze and manage cloud cost, usage, security, and governance. It builds a cloud asset inventory and allows for cost breakdown at the resource level.

    Komiser integrates with multiple cloud providers, including:

    • AWS
    • Azure
    • GCP
    • Civo
    • Digital Ocean
    • Kubernetes
    • OCI
    • Linode
    • Tencent
    • Scaleway
  3. Use tags in Komiser

    develop

    You can manage resources using tags in the Komiser Inventory section. There are two types of tags supported:

    1. Komiser tags: You can manually add tags to resources within the Komiser UI. Select the resources you wish to tag and click the tag resources button in the Inventory section.
    2. Cloud provider tags: If your resources are already tagged within your cloud provider (e.g., AWS, Azure, GCP), these tags will eventually be visible in the Komiser dashboard. You can use both Komiser-specific tags and cloud provider tags for filtering.
  4. Configure Scaleway credentials in Komiser

    develop

    To integrate Scaleway with Komiser, you must provide an accessKey, secretKey, and organizationId in your config.toml file.

    Steps to obtain credentials:

    1. Generate API Key: In the Scaleway console, go to Identity and Access Management (IAM) > API Keys and generate a new key to obtain your accessKey and secretKey.
    2. Locate Organization ID: Go to the Organization Dashboard and click Settings to find your organizationId.

    Single Account Configuration: Add a [[scaleway]] block to your config.toml.

    [[scaleway]]
    name="demo-scaleway-account"
    accessKey="access_key"
    secretKey="secret_key"
    organizationId="organization_id"
  5. Component directory and naming conventions

    develop

    Komiser dashboard components are located in the /components directory. The project uses specific import aliases defined in tsconfig.json to simplify imports:

    • @components/: /dashboard/components/
    • @services/: /dashboard/services/
    • @environments/: /dashboard/environments/
    • @utils/: /dashboard/utils/
    • @styles/: /dashboard/styles/

    Naming Conventions

    When creating new components, follow these file naming patterns:

    • Folder: kebab-case (e.g., my-component/)
    • Component file: UpperCamelCase.* (e.g., MyComponent.tsx)
    • Storybook story: UpperCamelCase.stories.* (e.g., MyComponent.stories.tsx)
    • Storybook mock: UpperCamelCase.mocks.* (e.g., MyComponent.mocks.ts)
    • Unit test: UpperCamelCase.test.* (e.g., MyComponent.test.tsx)
  6. Configure Oracle Cloud Infrastructure (OCI) in Komiser

    develop

    To manage OCI resources with Komiser, you must configure an [[oci]] block in your config.toml file. You can manage a single account or multiple accounts by adding multiple [[oci]] blocks.

    Supported OCI resources include:

    • Autonomous databases
    • Compute instances
    • Functions
    • Identity policies
    • Object storage
    • Storage block volumes
    [[oci]]
    name="sandbox-account"
    source="CREDENTIALS_FILE"
    path="Users/name/.oci/credentials"
    profile="default"
    
    [[oci]]
    name="admin-account"
    source="CREDENTIALS_FILE"
    path="Users/name/.oci/credentials"
    profile="ADMIN"
  7. Add a new component to Storybook

    develop

    Storybook is used to isolate and develop UI components. To add a new component to Storybook, follow these steps:

    1. Create the Story file: Create a file named [ComponentName].stories.tsx in the component directory.
    2. Define the Story: Use the ComponentMeta and ComponentStory types from @storybook/react to define the component and its default state.
    3. Add Variations: Create additional exported constants (e.g., export const Disabled = Template.bind({});) to represent different component states.
    4. Mock Data: If the component requires data, create a [ComponentName].mocks.[ext] file and import it into your story.
    5. Add Documentation: Use the parameters.docs.description.component key in the default export to add a description in the Storybook UI.

    Run Storybook locally:

    npm run storybook
    import React from 'react';
    import { ComponentStory, ComponentMeta } from '@storybook/react';
    
    import YourComponent from './YourComponent';
    
    export default {
      title: 'Path/To/YourComponent',
      component: YourComponent,
      parameters: {
        docs: {
          description: {
            component: 'Your description here...'
          }
        }
      }
    } as ComponentMeta<typeof YourComponent>;
    
    const Template: ComponentStory<typeof YourComponent> = args => (
      <YourComponent {...args} />
    );
    
    export const Default = Template.bind({});
    Default.args = {
      // default props here...
    };
    
    export const Disabled = Template.bind({});
    Disabled.args = {
      // props to set the component to its disabled state...
    };
  8. Disable Komiser telemetry data collection

    develop

    By default, the Komiser CLI collects anonymous usage data (feature usage) and error data (stack traces during panics). You can disable this data collection at any time by using the --telemetry command-line option when starting a Komiser instance.

    To disable telemetry, run:

    komiser start --telemetry false
  9. Create an Azure Service Principal for Komiser

    develop

    Use the Azure CLI (az) to create a service principal with Reader permissions for Komiser to access your subscriptions.

    1. Install the Azure CLI.
    2. Run az login.
    3. Set your subscription ID and register the security namespace.
    4. Execute the az ad sp create-for-rbac command to generate credentials.
    export subscriptionId=<YOUR_SUBSCRIPTION_ID>
    az account set --subscription $subscriptionId
    az provider register --namespace 'Microsoft.Security'
    
    # Create a service-principal for Komiser to use.
    az ad sp create-for-rbac --name komiser-sp --scopes /subscriptions/$subscriptionId --role Reader
  10. Set up OCI credentials for Komiser

    develop

    Komiser uses the CREDENTIALS_FILE method for OCI authentication.

    1. Generate OCI Config: Use the OCI CLI command oci setup config to walk through the setup of your tenancy OCID, user OCID, region, and API signing RSA key pair.
    2. Create Credentials File: Komiser expects a file named credentials (typically in your .oci folder). Copy the contents of your OCI config file into this credentials file.
    3. Update Key Path: Ensure the key_path in your credentials file points to the correct absolute path of your .pem private key.
    4. Configure Komiser: In config.toml, set the path to your credentials file and specify the correct profile (e.g., DEFAULT, ADMIN).
    [DEFAULT]
    user=ocid1.user.oc1....
    fingerprint=e8:99:10:45:54:c4:3d:c6:61:9e:42:e0:51:c0:76:cc
    key_path="/Users/jakepage/.oci/oci_api_key.pem"
    tenancy=ocid1.tenancy.oc1...
    region=eu-paris-1
    key_password=PASSWORD