diff --git a/Documentation/compatibility.md b/Documentation/compatibility.md new file mode 100644 index 000000000..595567020 --- /dev/null +++ b/Documentation/compatibility.md @@ -0,0 +1,26 @@ +# Compatibility + +The Prometheus Operator supports a number of Kubernetes and Prometheus releases. + +## Kubernetes + +The Prometheus Operator uses client-go to communicate with Kubernetes clusters. The supported Kubernetes cluster version is determined by client-go. The compatibility matrix for client-go and Kubernetes clusters can be found [here](https://github.com/kubernetes/client-go#compatibility-matrix). All additional compatibility is only best effort, or happens to still/already be supported. The currently used client-go version is "v4.0.0-beta.0". + +## Prometheus + +The versions of Prometheus compatible to be run with the Prometheus Operator are: + +* v1.4.0 +* v1.4.1 +* v1.5.0 +* v1.5.1 +* v1.5.2 +* v1.5.3 +* v1.6.0 +* v1.6.1 +* v1.6.2 +* v1.6.3 +* v1.7.0 +* v1.7.1 +* v2.0.0-alpha.3 +* v2.0.0-beta.0 diff --git a/Makefile b/Makefile index ca3b448b2..93802fa59 100644 --- a/Makefile +++ b/Makefile @@ -49,12 +49,13 @@ promu: embedmd: @go get github.com/campoy/embedmd -apidocgen: - @go install github.com/coreos/prometheus-operator/cmd/apidocgen +po-docgen: + @go install github.com/coreos/prometheus-operator/cmd/po-docgen -docs: embedmd apidocgen +docs: embedmd po-docgen $(GOPATH)/bin/embedmd -w `find Documentation -name "*.md"` - $(GOPATH)/bin/apidocgen pkg/client/monitoring/v1alpha1/types.go > Documentation/api.md + $(GOPATH)/bin/po-docgen api pkg/client/monitoring/v1alpha1/types.go > Documentation/api.md + $(GOPATH)/bin/po-docgen compatibility > Documentation/compatibility.md generate: jsonnet-docker docker run --rm -v `pwd`:/go/src/github.com/coreos/prometheus-operator po-jsonnet make jsonnet generate-bundle docs diff --git a/cmd/apidocgen/main.go b/cmd/po-docgen/api.go similarity index 98% rename from cmd/apidocgen/main.go rename to cmd/po-docgen/api.go index b3c38a35c..f5edbedd9 100644 --- a/cmd/apidocgen/main.go +++ b/cmd/po-docgen/api.go @@ -21,7 +21,6 @@ import ( "go/doc" "go/parser" "go/token" - "os" "reflect" "strings" ) @@ -48,17 +47,17 @@ var ( selfLinks = map[string]string{} ) -func main() { +func printAPIDocs(path string) { fmt.Println(firstParagraph) - types := ParseDocumentationFrom(os.Args[1]) + types := ParseDocumentationFrom(path) for _, t := range types { strukt := t[0] selfLinks[strukt.Name] = "#" + strings.ToLower(strukt.Name) } // we need to parse once more to now add the self links - types = ParseDocumentationFrom(os.Args[1]) + types = ParseDocumentationFrom(path) for _, t := range types { strukt := t[0] diff --git a/cmd/po-docgen/compatibility.go b/cmd/po-docgen/compatibility.go new file mode 100644 index 000000000..4a0570462 --- /dev/null +++ b/cmd/po-docgen/compatibility.go @@ -0,0 +1,39 @@ +// Copyright 2016 The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "fmt" + + "github.com/coreos/prometheus-operator/pkg/prometheus" +) + +func printCompatMatrixDocs() { + fmt.Println(`# Compatibility + +The Prometheus Operator supports a number of Kubernetes and Prometheus releases. + +## Kubernetes + +The Prometheus Operator uses client-go to communicate with Kubernetes clusters. The supported Kubernetes cluster version is determined by client-go. The compatibility matrix for client-go and Kubernetes clusters can be found [here](https://github.com/kubernetes/client-go#compatibility-matrix). All additional compatibility is only best effort, or happens to still/already be supported. The currently used client-go version is "v4.0.0-beta.0". + +## Prometheus + +The versions of Prometheus compatible to be run with the Prometheus Operator are: +`) + for _, v := range prometheus.CompatibilityMatrix { + fmt.Printf("* %s\n", v) + } +} diff --git a/cmd/po-docgen/main.go b/cmd/po-docgen/main.go new file mode 100644 index 000000000..37824ab59 --- /dev/null +++ b/cmd/po-docgen/main.go @@ -0,0 +1,28 @@ +// Copyright 2016 The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "os" +) + +func main() { + switch os.Args[1] { + case "api": + printAPIDocs(os.Args[2]) + case "compatibility": + printCompatMatrixDocs() + } +} diff --git a/pkg/prometheus/statefulset.go b/pkg/prometheus/statefulset.go index 805d1fb67..47134ec60 100644 --- a/pkg/prometheus/statefulset.go +++ b/pkg/prometheus/statefulset.go @@ -66,6 +66,7 @@ var ( "v1.7.0", "v1.7.1", "v2.0.0-alpha.3", + "v2.0.0-beta.0", } )