npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hashicorp/plugin-hcp-consul

v0.1.1

Published

This is a frontend plugin for viewing Hashicorp Cloud Platform(HCP) consul overview and service instances of a services. This plugin has a corresponding backend plugin required to call the HCP consul's API: @hashicorp/plugin-hcp-consul-backend.

Downloads

6

Readme

hcp-consul

This is a frontend plugin for viewing Hashicorp Cloud Platform(HCP) consul overview and service instances of a services. This plugin has a corresponding backend plugin required to call the HCP consul's API: @hashicorp/plugin-hcp-consul-backend.

Introduction

HCP Consul Central

HCP Consul Central is a management plane service hosted by HashiCorp that enables you to monitor and manage multiple Consul server clusters regardless of where the clusters are hosted.

Features

This plugin provides two items:

  • a plugin page to view overview of the project
  • a service instance component table

Getting started

Requirements

You will need to have the backend HCP consul plugin, @hashicorp/plugin-hcp-consul-backend, installed and running. See its README for set up instructions.

You will need clusters added in HCP Consul central. Learn more about HCP Consul Central.

You need to generate a service principal key. You can follow this tutorial to generate the clientID and client Secret.

Installation

# From your Backstage root directory
yarn add --cwd packages/app @hashicorp/plugin-hcp-consul

Configuration

Add configuration to your app-config.yaml. For example:

consul:
  clientID: abcdefabcdefabcdefabcdefabcdef
  clientSecret: xyxy111xyxy111xyxy111xyxy111xyxy111xyxy111xyxy111
  organizationID: ff14c2a2-a937-4240-bf11-9d23ca01761d
  projectID: f3945084-71ac-495c-84b3-371100d27279

HCP overview page

The snippet below adds the plugin page to the /hcp-consul path . The page shows overall overview of the clusters.

// In packages/app/src/App.tsx

import { HcpConsulPluginPage } from '@hashicorp/plugin-hcp-consul';

const routes = (
  <FlatRoutes>
    ...
    <Route path="/hcp-consul" element={<HcpConsulPluginPage />} />
);

Requirements

  • clientID, clientSecret and organizationID should be provided in the config file
  • Default projectID can be provided in the config file. To override it, the projectID can be added as part of props of the component. <HcpConsulPluginPage projectID="f3945084-71ac-495c-84b3-371100d27279"/>

Service Instance Table Component

The snippet below adds a /hcp-consul-instances tab to the EntityPage that displays all service instances of the service

// In packages/app/src/components/catalog/EntityPage.tsx

import { EntityServiceInstancesTable, isHcpConsulServiceAvailable } from '@hashicorp/plugin-hcp-consul';

const serviceEntityPage = (
    ...
    <EntityLayout.Route
        if={isHcpConsulServiceAvailable}
        path="/hcp-consul-instaces"
        title="Instances"
    >
      <EntityServiceInstancesTable />
    </EntityLayout.Route>
)

Requirements

The component should have the necessary annotations:

  • consul.io/cluster_resource_name annotation's value is the cluster resource name in HCP. It is required.
  • consul.io/name annotation's value is the service name. It is required
  • consul.io/namespace is the Namespace of the service. If omitted, it defaults to default
  • consul.io/partition is the Partition of the service. If omitted, it defaults to default
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  annotations:
    consul.io/cluster_resource_name: consul/project/f3945084-71ac-495c-84b3-371100d27279/cluster/consul-cluster
    consul.io/name: frontend
    consul.io/namespace: default
    consul.io/partition: default