Skip to content
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4093c68
Added LoadBalancer for Kind E2E test cluster
Nov 20, 2024
bec67ce
Added LoadBalancer for Kind E2E test cluster
Nov 20, 2024
3d8ed45
Added watch namesapces
Nov 21, 2024
6d4c370
Added tmate for debugging
Nov 21, 2024
d68510a
Added tmate for debugging
Nov 21, 2024
656df6d
Added tmate for debugging
Nov 21, 2024
095a77b
Added enabled projectcontour helm install
Nov 21, 2024
cb84940
Enabled cloud-provider-kind
Nov 21, 2024
20577d4
Added ProjectContour cluster role
Nov 21, 2024
5ecf22e
updated certificate name
Nov 22, 2024
2a5eb1e
updated certificate name
Nov 22, 2024
bd22523
Run without SSL
Nov 22, 2024
697dcb3
Removing Project Contour
Nov 25, 2024
f373314
Adding cloud-provider-kind
Nov 25, 2024
d073326
Removing cloud-provider - manually adding during test
Nov 25, 2024
11beda1
trigger test
Nov 25, 2024
44ecbaa
Remove SnpshotClusterAndCompare
Nov 25, 2024
88710c7
Increased log length for Snapshot and Compare
Nov 25, 2024
5f26efc
Re-Add Snapshot and compare
Nov 25, 2024
c04b3fa
Increased log length for Snapshot and Compare
Nov 25, 2024
3f99b3e
Increased log length even more
Nov 25, 2024
c13ddf0
Add Uninstall Contour CRDs
Nov 25, 2024
4a94850
Re-Add KafkaCluster_SSL Tests
Nov 25, 2024
9e0ea26
Removing BanzaiCloud Helm Chart from list of repos
Nov 26, 2024
9ac5dcf
trigger test
Nov 26, 2024
01cba15
Testing SSL - commengint out uninstalls
Nov 26, 2024
158abbf
Testing SSL - debugger
Nov 26, 2024
5865879
Include Uninstall and comment out debug
Nov 26, 2024
7445e75
PR Comments Addressed
Dec 4, 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
9 changes: 9 additions & 0 deletions .github/actions/kind-create/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,12 @@ runs:
chmod 600 $kubeconfig_path
echo "kubeconfig=$(echo $kubeconfig_path)" >> $GITHUB_OUTPUT
shell: bash

- name: Install cloud-provider-kind
id: cloud-provider-kind
run: |
echo "Install cloud-provider-kind"
go install sigs.k8s.io/cloud-provider-kind@latest
kubectl label node e2e-kind-control-plane node.kubernetes.io/exclude-from-external-load-balancers-
~/go/bin/cloud-provider-kind &
shell: bash
6 changes: 6 additions & 0 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: 1.21

# Enable Tmate Session if you'd like to Debut the E2E Kind Cluster
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# detached: true

- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Add Helm repositories
run: |
helm repo add banzaicloud-stable "https://kubernetes-charts.banzaicloud.com"
# helm repo add banzaicloud-stable "https://kubernetes-charts.banzaicloud.com"
helm repo add incubator "https://charts.helm.sh/incubator"
helm repo add stable "https://charts.helm.sh/stable"

Expand Down
6 changes: 6 additions & 0 deletions charts/kafka-operator/templates/operator-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ rules:
- '*'
verbs:
- '*'
- apiGroups:
- projectcontour.io
resources:
- '*'
verbs:
- '*'
- apiGroups:
- ""
resources:
Expand Down
2 changes: 1 addition & 1 deletion charts/kafka-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ operator:
# When this field is not empty and Cert-manager is used,
# the Cert-manager's Custom Resource Namespace must be included in the comma separated list.
# When it is empty, all namespaces will be watched.
namespaces: ""
namespaces: "kafka, cert-manager"
verboseLogging: false
developmentLogging: false
resources:
Expand Down
2 changes: 1 addition & 1 deletion config/samples/simplekafkacluster_ssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
# sslClientAuth defaults to be "required" for two-way SSL authentication, possible values are: "required", "requested", and "none"
# sslClientAuth: "requested"
sslSecrets:
tlsSecretName: "kafka-ca-certs"
tlsSecretName: "kafka-ca-certificate"
create: true
cruiseControlConfig:
# podSecurityContext:
Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const (
testExternalTopicName = "topic-test-external"
testInternalTopicName = "topic-test-internal"

defaultTLSSecretName = "test-secret"
defaultTLSSecretName = "kafka-ca-certificate"
kcatName = "kcat"
zookeeperKind = "zookeeperclusters.zookeeper.pravega.io"
zookeeperClusterName = "zookeeper-server"
Expand Down Expand Up @@ -75,6 +75,7 @@ func apiGroupKoperatorDependencies() map[string]string {
"cert-manager": "cert-manager.io",
"zookeeper": "zookeeper.pravega.io",
"prometheus": "monitoring.coreos.com",
"contour": "projectcontour.io",
}
}

Expand Down
5 changes: 5 additions & 0 deletions tests/e2e/test_uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,10 @@ func testUninstall() bool {
ConfigPath: kubectlOptions.ConfigPath,
Namespace: certManagerHelmDescriptor.Namespace,
})
requireUninstallingContour(k8s.KubectlOptions{
ContextName: kubectlOptions.ContextName,
ConfigPath: kubectlOptions.ConfigPath,
Namespace: contourIngressControllerHelmDescriptor.Namespace,
})
})
}
8 changes: 8 additions & 0 deletions tests/e2e/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type dependencyCRDsType struct {
zookeeper []string
prometheus []string
certManager []string
contour []string
}

func (c *dependencyCRDsType) Zookeeper() []string {
Expand All @@ -35,13 +36,20 @@ func (c *dependencyCRDsType) Prometheus() []string {
func (c *dependencyCRDsType) CertManager() []string {
return c.certManager
}
func (c *dependencyCRDsType) Contour() []string {
return c.contour
}

func (c *dependencyCRDsType) Initialize(kubectlOptions k8s.KubectlOptions) error {
var err error
c.certManager, err = listK8sResourceKinds(kubectlOptions, apiGroupKoperatorDependencies()["cert-manager"])
if err != nil {
return fmt.Errorf("initialize Cert-manager CRDs error: %w", err)
}
c.contour, err = listK8sResourceKinds(kubectlOptions, apiGroupKoperatorDependencies()["contour"])
if err != nil {
return fmt.Errorf("initialize Contour Ingress Controller CRDs error: %w", err)
}
c.prometheus, err = listK8sResourceKinds(kubectlOptions, apiGroupKoperatorDependencies()["prometheus"])
if err != nil {
return fmt.Errorf("initialize Prometheus CRDs error: %w", err)
Expand Down
43 changes: 43 additions & 0 deletions tests/e2e/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,49 @@ func requireRemoveCertManagerCRDs(kubectlOptions k8s.KubectlOptions) {
}
})
}
func requireUninstallingContour(kubectlOptions k8s.KubectlOptions) {
When("Uninstalling zookeeper-operator", func() {
requireUninstallingContourHelmChart(kubectlOptions)
requireRemoveContourCRDs(kubectlOptions)
requireRemoveNamespace(kubectlOptions, contourIngressControllerHelmDescriptor.Namespace)
})
}

// requireUninstallingCertManagerHelmChart uninstalls cert-manager helm chart
// and checks the success of that operation.
func requireUninstallingContourHelmChart(kubectlOptions k8s.KubectlOptions) {
It("Uninstalling Project Contour Helm chart", func() {
err := contourIngressControllerHelmDescriptor.uninstallHelmChart(kubectlOptions, true)
Expect(err).NotTo(HaveOccurred())

By("Verifying Project Contour helm chart resources cleanup")

k8sResourceKinds, err := listK8sResourceKinds(kubectlOptions, "")
Expect(err).ShouldNot(HaveOccurred())

contourAvailableResourceKinds := stringSlicesInstersect(dependencyCRDs.Contour(), k8sResourceKinds)
contourAvailableResourceKinds = append(contourAvailableResourceKinds, basicK8sResourceKinds()...)

remainedResources, err := getK8sResources(kubectlOptions,
contourAvailableResourceKinds,
fmt.Sprintf(managedByHelmLabelTemplate, contourIngressControllerHelmDescriptor.ReleaseName),
"",
kubectlArgGoTemplateKindNameNamespace,
"--all-namespaces")
Expect(err).ShouldNot(HaveOccurred())

Expect(remainedResources).Should(BeEmpty())
})
}

func requireRemoveContourCRDs(kubectlOptions k8s.KubectlOptions) {
It("Removing Contour Ingress Controller CRDs", func() {
for _, crd := range dependencyCRDs.Contour() {
err := deleteK8sResourceNoErrNotFound(kubectlOptions, defaultDeletionTimeout, crdKind, crd)
Expect(err).ShouldNot(HaveOccurred())
}
})
}

// requireRemoveNamespace deletes the indicated namespace object
func requireRemoveNamespace(kubectlOptions k8s.KubectlOptions, namespace string) {
Expand Down
Loading