Skip to content

jDmacD/backstage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

115 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is your newly scaffolded Backstage App, Good Luck!

To start the app, run:

yarn install
yarn start

TODO

Custom Entity Provider

I can use steampipe to populate the catalog using postgres queries.

SELECT 
  jsonb_build_object(
    'apiVersion', 'backstage.io/v1alpha1',
    'kind', 'Component',
    'metadata', jsonb_build_object(
      'name', name,
      'annotations', jsonb_build_object(
        'argocd/app-name', name,
        'backstage.io/kubernetes-id', name
      )
    ),
    'spec', jsonb_build_object(
      'type', 'website',
      'lifecycle', 'experimental',
      'owner', 'user:default/jmacdonald_jtec.xyz',
      'system', 'examples',
      'dependsOn', jsonb_build_array(
        'resource:turing',
        'component:cilium'
      )
    )
  ) AS result
FROM kubernetes_application;

The configuration would look something like

catalog:
  providers:
    postgres-provider:
      schedule:
        initialDelay: { seconds: 30 }
        frequency: { hours: 1 }
        timeout: { minutes: 50 }
    entities:
      - name: Argo CD Applications
        connection:
          host: ${POSTGRES_HOST}
          port: ${POSTGRES_PORT}
          user: ${POSTGRES_USER}
          password: ${POSTGRES_PASSWORD}
        query: |
          SELECT 
            jsonb_build_object(
              'apiVersion', 'backstage.io/v1alpha1',
              'kind', 'Component',
              'metadata', jsonb_build_object(
                'name', name,
                'namespace', destination::jsonb ->> 'namespace',
                'annotations', jsonb_build_object(
                  'argocd/app-name', name,
                  'backstage.io/kubernetes-id', name
                ),
              )
              'spec', jsonb_build_object(
                'type', 'website',
                'lifecycle', 'production',
                'owner', 'user:default/jmacdonald_jtec.xyz',
                'system', 'turing',
                'dependsOn', json_build_array(
                  'resource:turing'
                )
              )
            ) as result
          FROM 
            kubernetes_application

Another option would be use the a url location

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors