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

New chart: Chainloop #27100

Merged
merged 37 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1a56936
New chart: Chainloop
javirln Jun 11, 2024
2c67896
Update CHANGELOG.md
bitnami-bot Jun 11, 2024
4b5cc1d
Update README.md with readme-generator-for-helm
bitnami-bot Jun 11, 2024
189c9b1
Fix README links
javirln Jun 11, 2024
7cb347c
Modify license headers
javirln Jun 12, 2024
52a8c56
Update CHANGELOG.md
bitnami-bot Jun 12, 2024
78af872
Fix README.md linter
javirln Jun 12, 2024
008ce9c
Update README.md with readme-generator-for-helm
bitnami-bot Jun 12, 2024
5964208
More changes on linter
javirln Jun 12, 2024
61eeef3
remove links
javirln Jun 12, 2024
18e52b5
Update chart dependency
javirln Jun 12, 2024
1848dab
Generate README.md
javirln Jun 13, 2024
76789e4
Update CHANGELOG.md
bitnami-bot Jun 13, 2024
293a779
Update CHANGELOG.md
bitnami-bot Jun 14, 2024
ad82d26
chore: update chart
migmartri Jul 24, 2024
fcef25e
chore: update chart
migmartri Jul 24, 2024
535814f
chore: update chart
migmartri Jul 24, 2024
86f51c8
Update chart with bitnami standards
javirln Aug 5, 2024
1bc19ce
Fix linter
javirln Aug 5, 2024
06edb70
Fix README and values.yaml
javirln Aug 5, 2024
af4b080
Remove dex subchart and push it one level up
javirln Aug 5, 2024
792c2d8
Update CHANGELOG.md
bitnami-bot Aug 5, 2024
8d6f98b
change readme
javirln Aug 5, 2024
f74a6e2
templates and values.yaml feedback
javirln Aug 7, 2024
7cdb1b4
Update CHANGELOG.md
bitnami-bot Aug 7, 2024
8940861
Include chainloop bitnami images
javirln Aug 7, 2024
00fb1ad
Update readme
javirln Aug 7, 2024
167bb64
add networkpolicies and reduce number of extra and skip params
javirln Aug 7, 2024
ff7d98e
skip .tag params
javirln Aug 7, 2024
7ecedad
fix tests
javirln Aug 7, 2024
a5f8ff0
fix networkpolicy and add pdb
javirln Aug 7, 2024
d17f275
fix readme
javirln Aug 7, 2024
a42e0e1
increase test time
javirln Aug 7, 2024
e186f24
add missing parameter to verify step
javirln Aug 7, 2024
16d8fce
add vpa to cas and controlplane
javirln Aug 8, 2024
de6a509
Update CHANGELOG.md
bitnami-bot Aug 8, 2024
e8d2383
tackle feedback
javirln Aug 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .vib/chainloop/ginkgo/chainloop_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package chainloop_test

import (
"flag"
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var (
kubeconfig string
releaseName string
namespace string
timeoutSeconds int
)

func init() {
flag.StringVar(&kubeconfig, "kubeconfig", "", "absolute path to the kubeconfig file")
flag.StringVar(&releaseName, "name", "", "name of the primary statefulset")
flag.StringVar(&namespace, "namespace", "", "namespace where the application is running")
flag.IntVar(&timeoutSeconds, "timeout", 180, "timeout in seconds")
}

func TestChainloop(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Chainloop Persistence Test Suite")
}
147 changes: 147 additions & 0 deletions .vib/chainloop/ginkgo/chainloop_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
package chainloop_test

import (
"context"
"fmt"
utils "github.com/bitnami/charts/.vib/common-tests/ginkgo-utils"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)

// portDefinition is a struct to define a port in a service
type portDefinition struct {
name string
number string
}

var _ = Describe("Chainloop", Ordered, func() {
var c *kubernetes.Clientset
var ctx context.Context
var cancel context.CancelFunc

BeforeEach(func() {
ctx, cancel = context.WithCancel(context.Background())

conf := utils.MustBuildClusterConfig(kubeconfig)
c = kubernetes.NewForConfigOrDie(conf)
})

When("Chainloop chart is fully deployed", func() {
It("all services exposes expected ports", func() {
svcs := []struct {
name string
ports []portDefinition
}{
{
name: "cas",
ports: []portDefinition{
{
name: "http",
number: "80",
},
},
},
{
name: "cas-api",
ports: []portDefinition{
{
name: "grpc",
number: "80",
},
},
},
{
name: "controlplane",
ports: []portDefinition{
{
name: "http",
number: "80",
},
},
},
{
name: "controlplane-api",
ports: []portDefinition{
{
name: "grpc",
number: "80",
},
},
},
{
name: "postgresql",
ports: []portDefinition{
{
name: "tcp-postgresql",
number: "5432",
},
},
},
{
name: "vault-server",
ports: []portDefinition{
{
name: "http",
number: "8200",
}, {
name: "https-internal",
number: "8201",
},
},
},
{
name: "dex",
ports: []portDefinition{
{
name: "http",
number: "5556",
}, {
name: "grpc",
number: "5557",
},
},
},
}

for _, inSvc := range svcs {
svcName := fmt.Sprintf("%v-%v", releaseName, inSvc.name)
svc, err := c.CoreV1().Services(namespace).Get(ctx, svcName, metav1.GetOptions{})
Expect(err).NotTo(HaveOccurred())

for _, port := range inSvc.ports {
outPort, err := utils.SvcGetPortByName(svc, port.name)
Expect(err).NotTo(HaveOccurred())
Expect(outPort).NotTo(BeNil())
Expect(outPort).To(Equal(port.number))
}
}
})

It("all pods are running", func() {
pods, err := c.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{})
Expect(err).NotTo(HaveOccurred())

for _, pod := range pods.Items {
_, err := utils.IsPodRunning(ctx, c.CoreV1(), namespace, pod.Name)
Expect(err).NotTo(HaveOccurred())
}
})

It("all deployments are running", func() {
dpls := []string{"cas", "controlplane", "dex", "vault-injector"}

for _, dplName := range dpls {
dpl, err := c.AppsV1().Deployments(namespace).Get(ctx, fmt.Sprintf("%v-%v", releaseName, dplName), metav1.GetOptions{})
Expect(err).NotTo(HaveOccurred())

Expect(dpl.Status.ReadyReplicas).To(Equal(*dpl.Spec.Replicas))
}
})
})

AfterEach(func() {
cancel()
})
})
57 changes: 57 additions & 0 deletions .vib/chainloop/ginkgo/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
module test-chainloop-chart

go 1.20

replace github.com/bitnami/charts/.vib/common-tests/ginkgo-utils => ../../common-tests/ginkgo-utils

require (
github.com/bitnami/charts/.vib/common-tests/ginkgo-utils v0.0.0-00010101000000-000000000000
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.8
k8s.io/api v0.28.0
k8s.io/apimachinery v0.28.0
k8s.io/client-go v0.28.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading
Loading