Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve resource types from the cluster instead of hard coding them #45

Open
InfoSec812 opened this issue Jul 15, 2020 · 1 comment
Open

Comments

@InfoSec812
Copy link

As a developer who works across a number of different Kubernetes cluster from a number of different vendors, and as a developer using Operators in K8s; I would like to have a way to convert existing resources of types not currently defined in this application.

For example, if using the Strimzi Operator for deploying Kafka clusters, I would want to be able to extract, templatize, and convert to a chart the Custom Resource Definitions for Strimzi.

type KubeObjects struct {

@InfoSec812
Copy link
Author

For example, on an OpenShift 4.2 cluster...

curl -s -H "Authorization: Bearer <REDACTED>" "https://cluster.example.com/openapi/v2" | jq '.definitions | keys'

[
  "com.coreos.monitoring.v1.Alertmanager",
  "com.coreos.monitoring.v1.AlertmanagerList",
  "com.coreos.monitoring.v1.PodMonitor",
  "com.coreos.monitoring.v1.PodMonitorList",
  "com.coreos.monitoring.v1.Prometheus",
  "com.coreos.monitoring.v1.PrometheusList",
  "com.coreos.monitoring.v1.PrometheusRule",
  "com.coreos.monitoring.v1.PrometheusRuleList",
  "com.coreos.monitoring.v1.ServiceMonitor",
  "com.coreos.monitoring.v1.ServiceMonitorList",
  "com.coreos.operators.v1.CatalogSourceConfig",
  "com.coreos.operators.v1.CatalogSourceConfigList",
  "com.coreos.operators.v1.OperatorGroup",
  "com.coreos.operators.v1.OperatorGroupList",
//.. SNIP ..//
  "org.integreatly.v1alpha1.Grafana",
  "org.integreatly.v1alpha1.GrafanaDashboard",
  "org.integreatly.v1alpha1.GrafanaDashboardList",
  "org.integreatly.v1alpha1.GrafanaDataSource",
  "org.integreatly.v1alpha1.GrafanaDataSourceList",
  "org.integreatly.v1alpha1.GrafanaList"
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant