1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Maintenance] Generate README Platforms (#1257)

This commit is contained in:
Adam Janikowski 2023-02-24 12:16:35 +01:00 committed by GitHub
parent b9aed8e6fa
commit 8bc4d497d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 212 additions and 17 deletions

View file

@ -18,6 +18,7 @@
- (Feature) Optional JSON logger format
- (Improvement) Change Operator default ReplicasCount to 1
- (Maintenance) Change MD content injection method
- (Maintenance) Generate README Platforms
## [1.2.24](https://github.com/arangodb/kube-arangodb/tree/1.2.24) (2023-01-25)
- (Bugfix) Fix deployment creation on ARM64

View file

@ -29,22 +29,22 @@ Kubernetes versions starting from 1.18 are supported and tested, charts and mani
The following table has the general readiness state, the table below
covers individual newer features separately.
| Platform | Kubernetes Version | ArangoDB Version | State | Remarks | Provider Remarks |
|---------------------|--------------------|------------------|------------|------------------------------------------------------------------|------------------------------------|
| Google GKE | 1.22-1.25 | >= 3.6.0 | Production | Don't use micro nodes | |
| Azure AKS | 1.21-1.24 | >= 3.6.0 | Production | | |
| Amazon EKS | 1.21-1.24 | >= 3.6.0 | Production | | [Amazon EKS](./docs/providers/eks) |
| IBM Cloud | 1.17 | >= 3.6.0 | Deprecated | Support will be dropped in Operator 1.5.0 | |
| IBM Cloud | 1.18 | >= 3.6.0 | Production | | |
| IBM Cloud | 1.19 | >= 3.6.0 | Production | | |
| IBM Cloud | 1.20 | >= 3.6.0 | Production | | |
| IBM Cloud | 1.21 | >= 3.6.0 | Production | | |
| OpenShift | 3.11 | >= 3.6.0 | Deprecated | Support will be dropped in Operator 1.5.0 | |
| OpenShift | 4.2-4.11 | >= 3.6.0 | Production | | |
| BareMetal (kubeadm) | 1.16-1.17 | >= 3.6.0 | Deprecated | Support will be dropped in Operator 1.5.0 | |
| BareMetal (kubeadm) | 1.18-1.25 | >= 3.6.0 | Production | | |
| Minikube | 1.18+ | >= 3.6.0 | Devel Only | | |
| Other | 1.18+ | >= 3.6.0 | Devel Only | | |
<!-- START(metricsTable) -->
| Platform | Kubernetes Version | ArangoDB Version | State | Remarks | Provider Remarks |
|:--------------------|:-------------------|:-----------------|:-----------|:------------------------------------------|:-----------------------------------|
| Google GKE | 1.21-1.25 | >= 3.6.0 | Production | Don't use micro nodes | |
| Azure AKS | 1.21-1.24 | >= 3.6.0 | Production | | |
| Amazon EKS | 1.21-1.24 | >= 3.6.0 | Production | | [Amazon EKS](./docs/providers/eks) |
| IBM Cloud | 1.17 | >= 3.6.0 | Deprecated | Support will be dropped in Operator 1.5.0 | |
| IBM Cloud | 1.18-1.21 | >= 3.6.0 | Production | | |
| OpenShift | 3.11 | >= 3.6.0 | Deprecated | Support will be dropped in Operator 1.5.0 | |
| OpenShift | 4.2-4.11 | >= 3.6.0 | Production | | |
| BareMetal (kubeadm) | <= 1.20 | >= 3.6.0 | Deprecated | Support will be dropped in Operator 1.5.0 | |
| BareMetal (kubeadm) | 1.21-1.25 | >= 3.6.0 | Production | | |
| Minikube | 1.21-1.25 | >= 3.6.0 | Devel Only | | |
| Other | 1.21-1.25 | >= 3.6.0 | Devel Only | | |
<!-- END(metricsTable) -->
Feature-wise production readiness table:

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

55
internal/platforms.yaml Normal file
View file

@ -0,0 +1,55 @@
platforms:
- name: "Google GKE"
versions:
- kubernetesVersion: "1.21-1.25"
arangoDBVersion: ">= 3.6.0"
state: "Production"
remarks: "Don't use micro nodes "
- name: "Azure AKS"
versions:
- kubernetesVersion: "1.21-1.24"
arangoDBVersion: ">= 3.6.0"
state: "Production"
- name: "Amazon EKS"
versions:
- kubernetesVersion: "1.21-1.24"
arangoDBVersion: ">= 3.6.0"
state: "Production"
providerRemarks: "[Amazon EKS](./docs/providers/eks)"
- name: "IBM Cloud"
versions:
- kubernetesVersion: "1.17"
arangoDBVersion: ">= 3.6.0"
state: "Deprecated"
remarks: "Support will be dropped in Operator 1.5.0"
- kubernetesVersion: "1.18-1.21"
arangoDBVersion: ">= 3.6.0"
state: "Production"
- name: "OpenShift"
versions:
- kubernetesVersion: "3.11"
arangoDBVersion: ">= 3.6.0"
state: "Deprecated"
remarks: "Support will be dropped in Operator 1.5.0"
- kubernetesVersion: "4.2-4.11"
arangoDBVersion: ">= 3.6.0"
state: "Production"
- name: "BareMetal (kubeadm)"
versions:
- kubernetesVersion: "<= 1.20"
arangoDBVersion: ">= 3.6.0"
state: "Deprecated"
remarks: "Support will be dropped in Operator 1.5.0"
- kubernetesVersion: "1.21-1.25"
arangoDBVersion: ">= 3.6.0"
state: "Production"
- name: "Minikube"
versions:
- kubernetesVersion: "1.21-1.25"
arangoDBVersion: ">= 3.6.0"
state: "Devel Only"
- name: "Other"
versions:
- kubernetesVersion: "1.21-1.25"
arangoDBVersion: ">= 3.6.0"
state: "Devel Only"

105
internal/readme.go Normal file
View file

@ -0,0 +1,105 @@
//
// DISCLAIMER
//
// Copyright 2023 ArangoDB GmbH, Cologne, Germany
//
// 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.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package internal
import (
"os"
"path"
"gopkg.in/yaml.v3"
"github.com/arangodb/kube-arangodb/internal/md"
"github.com/arangodb/kube-arangodb/pkg/util"
)
type PlatformsDoc struct {
Platforms Platforms `json:"platforms,omitempty" yaml:"platforms,omitempty"`
}
type Platforms []Platform
type Platform struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Versions []PlatformVersion `json:"versions,omitempty" yaml:"versions,omitempty"`
}
type PlatformVersion struct {
KubernetesVersion *string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"`
ArangoDBVersion *string `json:"arangoDBVersion,omitempty" yaml:"arangoDBVersion,omitempty"`
State *string `json:"state,omitempty" yaml:"state,omitempty"`
Remarks *string `json:"remarks,omitempty" yaml:"remarks,omitempty"`
ProviderRemarks *string `json:"providerRemarks,omitempty" yaml:"providerRemarks,omitempty"`
}
func GenerateReadme(root string) error {
readmeSections := map[string]string{}
{
platform := md.NewColumn("Platform", md.ColumnLeftAlign)
kVersion := md.NewColumn("Kubernetes Version", md.ColumnLeftAlign)
aVersion := md.NewColumn("ArangoDB Version", md.ColumnLeftAlign)
state := md.NewColumn("State", md.ColumnLeftAlign)
remarks := md.NewColumn("Remarks", md.ColumnLeftAlign)
pRemarks := md.NewColumn("Provider Remarks", md.ColumnLeftAlign)
t := md.NewTable(
platform,
kVersion,
aVersion,
state,
remarks,
pRemarks,
)
var d PlatformsDoc
data, err := os.ReadFile(path.Join(root, "internal", "platforms.yaml"))
if err != nil {
return err
}
if err := yaml.Unmarshal(data, &d); err != nil {
return err
}
for _, p := range d.Platforms {
for _, v := range p.Versions {
if err := t.AddRow(map[md.Column]string{
platform: p.Name,
kVersion: util.StringOrDefault(v.KubernetesVersion, ""),
aVersion: util.StringOrDefault(v.ArangoDBVersion, ""),
state: util.StringOrDefault(v.State, ""),
remarks: util.StringOrDefault(v.Remarks, ""),
pRemarks: util.StringOrDefault(v.ProviderRemarks, ""),
}); err != nil {
return err
}
}
}
readmeSections["metricsTable"] = md.WrapWithNewLines(t.Render())
}
if err := md.ReplaceSectionsInFile(path.Join(root, "README.md"), readmeSections); err != nil {
return err
}
return nil
}

34
internal/readme_test.go Normal file
View file

@ -0,0 +1,34 @@
//
// DISCLAIMER
//
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
//
// 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.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package internal
import (
"os"
"testing"
"github.com/stretchr/testify/require"
)
func Test_GenerateReadme(t *testing.T) {
root := os.Getenv("ROOT")
require.NoError(t, GenerateReadme(root))
}