Explorar el Código

Merge branch 'develop' into bolt/dependency-refactor

Matt Bolt hace 6 años
padre
commit
9ec275709e
Se han modificado 2 ficheros con 16 adiciones y 4 borrados
  1. 4 4
      README.md
  2. 12 0
      pkg/costmodel/router.go

+ 4 - 4
README.md

@@ -1,12 +1,12 @@
-Kubecost models give teams visibility into current and historical Kubernetes spend and resource allocation. These models  provide cost transparency in Kubernetes environments that support multiple applications, teams, departments, etc.
+## Kubecost
 
-![Kubecost dashboard](https://github.com/kubecost/cost-model/blob/master/allocation-dashboard.png)
+Kubecost models give teams visibility into current and historical Kubernetes spend and resource allocation. These models  provide cost transparency in Kubernetes environments that support multiple applications, teams, departments, etc.
 
 To see more on the functionality of the full Kubecost product, please visit the [features page](https://kubecost.com/#features) on our website. 
 Here is a summary of features enabled by this cost model:
 
-- Real-time cost allocation for native Kubernetes concepts: service, deployment, namespace, label, daemonset, pod, container, and more
-- Dynamic asset pricing enabled by integrations with AWS, Azure and GCP billing APIs 
+- Real-time cost allocation by Kubernetes service, deployment, namespace, label, statefulset, daemonset, pod, and container
+- Dynamic asset pricing enabled by integrations with AWS, Azure, and GCP billing APIs 
 - Supports on-prem k8s clusters with custom pricing sheets
 - Allocation for in-cluster resources like CPU, GPU, memory, and persistent volumes.
 - Allocation for AWS & GCP out-of-cluster resources like RDS instances and S3 buckets with key (optional)

+ 12 - 0
pkg/costmodel/router.go

@@ -579,6 +579,18 @@ func (p *Accesses) ClusterInfo(w http.ResponseWriter, r *http.Request, ps httpro
 	w.Header().Set("Access-Control-Allow-Origin", "*")
 
 	data, err := p.Cloud.ClusterInfo()
+
+	kc, ok := p.KubeClientSet.(*kubernetes.Clientset)
+	if ok && data != nil {
+		v, err := kc.ServerVersion()
+		if err != nil {
+			klog.Infof("Could not get k8s version info: %s", err.Error())
+		} else if v != nil {
+			data["version"] = v.Major + "." + v.Minor
+		}
+	} else {
+		klog.Infof("Could not get k8s version info: %s", err.Error())
+	}
 	w.Write(WrapData(data, err))
 
 }