replicatedhq / kots

KOTS provides the framework, tools and integrations that enable the delivery and management of 3rd-party Kubernetes applications, a.k.a. Kubernetes Off-The-Shelf (KOTS) Software.
https://kots.io
Apache License 2.0
901 stars 90 forks source link

Expose Troubleshoot Collector/Analyzer insights in kots template context #246

Open dexhorthy opened 4 years ago

dexhorthy commented 4 years ago

For insights generated by https://troubleshoot.sh, it would be great to access some of the values in the kots CLI template context. Maybe these could be stored in upstream/userdata or something each time preflight checks are executed?

Example

Troubleshoot has a collector/analyzer for "Kubernetes Distro", to check for it would be great to be able to access collector results in the template context, e.g.


apiVersion: v1
kind: Route
metadata:
  name: host-route
  annotations:
    kots.io/when: '{{repl (eq (TroubleshootCollector "kubernetesDistro") "openshift") }}'
spec:
  host: www.example.com  
  to:
    kind: Service
    name: service-name
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: host-route
  annotations:
    kots.io/when: '{{repl not (eq (TroubleshootCollector "kubernetesDistro") "openshift") }}'
spec:
  backend:
    serviceName: service-name
    servicePort: 8080
marccampbell commented 4 years ago

These are being added individually -- we have the Distribution available as a template function now.

We can't pull all of these in as suggested in this issue because the troubleshoot project has a collect - analyze phase. These are not generated at runtime, they need a support bundle (output of the troubleshoot collect phase) as context.

Having some of these in would be great. Not all make sense, but I don't think this issue is suggesting that.

We have Distribution and Kurl parameters. What other template functions should be added?