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

Ensuring that app status field is correctly updated on app update #1342

Merged
merged 173 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
ff83a10
Null check on crd object list in mutating webhook delete
devdattakulkarni Dec 18, 2023
bcd1fbc
Removing previous chart if one exists (helmer and kubeconfiggenerator)
devdattakulkarni Dec 18, 2023
1e52294
README and examples updates to use KubePlus 3.0.31
devdattakulkarni Dec 18, 2023
3bcf670
Plugins update
devdattakulkarni Dec 18, 2023
87afcc1
Added utility to parse API server URL of the current context
devdattakulkarni Dec 21, 2023
f4ac45d
For metrics and logs using Pods within the NS of the instance
devdattakulkarni Dec 30, 2023
49d68ad
Merging kubeplus-kubectl-plugins.tar.gz from master branch
devdattakulkarni Dec 30, 2023
d36b7f0
Adding a label to identify CRDs registered by KubePlus
devdattakulkarni Jan 7, 2024
ea2f55b
KubePlus chart - 3.0.32
devdattakulkarni Jan 7, 2024
42722a7
Application upgrade improvements
devdattakulkarni Jan 10, 2024
3ee39d0
KubePlus chart - 3.0.33
devdattakulkarni Jan 10, 2024
2c293f1
Examples and README updates to use KubePlus chart - 3.0.33
devdattakulkarni Jan 10, 2024
b5f3c50
Service CRD name check
devdattakulkarni Feb 7, 2024
0dda834
KubePlus chart update - 3.0.34
devdattakulkarni Feb 7, 2024
5b16f8b
Merge branch 'master' into develop
devdattakulkarni Feb 7, 2024
df33fd1
Resourcecomposition upgrade update
devdattakulkarni Feb 16, 2024
75c946b
KubePlus chart - 3.0.35
devdattakulkarni Feb 16, 2024
7b63caa
Merge branch 'master' into develop
devdattakulkarni Feb 16, 2024
e68b41c
Merge branch 'master' into develop
devdattakulkarni Feb 16, 2024
fd82ecc
Examples and README updated to refer to 3.0.35 chart
devdattakulkarni Feb 16, 2024
e48af2e
Update to parse-api-server-url.sh
devdattakulkarni Feb 16, 2024
5b37719
Merge branch 'master' into develop
devdattakulkarni Feb 16, 2024
5612568
Merge branch 'master' of https://github.com/cloud-ark/kubeplus into d…
devdattakulkarni Apr 7, 2024
10b29e1
README updates
devdattakulkarni Apr 7, 2024
a2aebd7
Added slack channel on CNCF workspace
devdattakulkarni Apr 12, 2024
9ea2f19
KubePlus control center script removal
devdattakulkarni Apr 17, 2024
2193c12
Contributing doc updates
devdattakulkarni Apr 17, 2024
056fc08
README updates
devdattakulkarni Apr 17, 2024
a52b7b1
Merge branch 'master' into develop
devdattakulkarni Apr 17, 2024
1f138ed
Merge branch 'master' into develop
devdattakulkarni Apr 18, 2024
20ae0db
Wordpress example steps update
devdattakulkarni Apr 18, 2024
a18bad3
Merge branch 'master' into develop
devdattakulkarni Apr 25, 2024
086899c
Test suite update
devdattakulkarni Apr 25, 2024
1c9f87a
Tests update
devdattakulkarni Apr 25, 2024
74487fc
Merge branch 'master' into develop
devdattakulkarni Apr 26, 2024
5ae6bf0
Added README in tests folder
devdattakulkarni Apr 26, 2024
f9f9ca4
Merge branch 'master' into develop
devdattakulkarni Apr 26, 2024
b2c3510
KubePlus Helm chart update - 3.0.36
devdattakulkarni Apr 26, 2024
373b29c
Merge branch 'master' into develop
devdattakulkarni Apr 28, 2024
c9adc75
Updated command-line flag help messages in provider kubeconfiggenerator
devdattakulkarni Apr 28, 2024
e1fe830
Tests update
devdattakulkarni Apr 28, 2024
26cc793
Merge branch 'master' into develop
devdattakulkarni Apr 29, 2024
0ce98ec
Modified provider-kubeconfig.py to extract kubeconfig from a cluster
devdattakulkarni Apr 7, 2024
116e8d7
provider-kubeconfig.py cleanup
devdattakulkarni Apr 29, 2024
b55c41d
Merge branch 'master' into develop
devdattakulkarni Apr 29, 2024
c29f03e
Merge branch 'master' into develop
devdattakulkarni Apr 30, 2024
8e7ba93
Updated Contributing guidelines
devdattakulkarni Apr 30, 2024
800903f
Merge branch 'master' into develop
devdattakulkarni Apr 30, 2024
0e13271
hello-world example update
devdattakulkarni Apr 30, 2024
3084fe8
wordpress example update
devdattakulkarni Apr 30, 2024
67ddf3a
Merge branch 'master' into develop
devdattakulkarni Apr 30, 2024
a822683
Documentation updates
devdattakulkarni May 1, 2024
7b1ea4d
Merge branch 'master' into develop
devdattakulkarni May 1, 2024
1623dae
README updates
devdattakulkarni May 1, 2024
c6f195c
Merge branch 'master' into develop
devdattakulkarni May 1, 2024
1ca86a8
Consumer UI updates
devdattakulkarni May 4, 2024
7b7a19b
Merge branch 'master' into develop
devdattakulkarni May 4, 2024
a7cd13a
KubePlus chart update - 3.0.37
devdattakulkarni May 4, 2024
e22b0a5
Link to Slack invitation and includes missing updates to Chart.yaml
devdattakulkarni May 6, 2024
d1e8a00
Merge branch 'master' into develop
devdattakulkarni May 6, 2024
e86b689
Application upgrade
devdattakulkarni May 8, 2024
ff5db0c
Merge branch 'master' into develop
devdattakulkarni May 8, 2024
a602470
KubePlus chart - 3.0.38
devdattakulkarni May 8, 2024
e90d28f
Merge branch 'master' into develop
devdattakulkarni May 8, 2024
6a7d383
Merge branch 'master' into develop
devdattakulkarni May 8, 2024
0d26fb0
Added Use cases
devdattakulkarni May 8, 2024
a124418
Merge branch 'master' into develop
devdattakulkarni May 8, 2024
74d6767
Use cases - correct links
devdattakulkarni May 8, 2024
186da0b
Merge branch 'master' into develop
devdattakulkarni May 9, 2024
ed510d8
README updated
devdattakulkarni May 9, 2024
cf2e0dc
Merge branch 'master' into develop
devdattakulkarni May 9, 2024
47d084a
Examples - cleanup
devdattakulkarni May 10, 2024
0b2b896
Merge branch 'master' into develop
devdattakulkarni May 10, 2024
8ffb393
Docs cleanup
devdattakulkarni May 10, 2024
93e8eb5
mutating-webhook - folder cleanup
devdattakulkarni May 10, 2024
c192a2c
Merge branch 'master' into develop
devdattakulkarni May 10, 2024
9243351
platform-operator cleanup
devdattakulkarni May 10, 2024
5099a47
Merge branch 'master' into develop
devdattakulkarni May 10, 2024
57fac82
plugins folder cleanup
devdattakulkarni May 10, 2024
0e41c1a
Merge branch 'master' into develop
devdattakulkarni May 10, 2024
52626c0
More cleanup
devdattakulkarni May 10, 2024
e42a952
Merge branch 'master' into develop
devdattakulkarni May 10, 2024
14d5e9f
Cleanup ++
devdattakulkarni May 10, 2024
56e5b86
Dockerfile updates to download kubectl and helm binaries
devdattakulkarni May 11, 2024
49b4d8e
KubePlus chart - 3.0.39
devdattakulkarni May 11, 2024
007654e
Merge branch 'master' into develop
devdattakulkarni May 11, 2024
07f4eda
Added link to KubePlus mailing list
devdattakulkarni May 14, 2024
1685579
Merge branch 'master' into develop
devdattakulkarni May 16, 2024
dd0ec71
README updates
devdattakulkarni May 16, 2024
13fdc8e
README update
devdattakulkarni May 31, 2024
753bdf2
Merge branch 'master' into develop
devdattakulkarni Jun 3, 2024
9053ff7
GitHub Actions
devdattakulkarni Jun 3, 2024
03d789b
Github actions - take 2
devdattakulkarni Jun 3, 2024
c2c7506
Github actions - take 4
devdattakulkarni Jun 3, 2024
94b44ba
Github actions - take 5
devdattakulkarni Jun 3, 2024
1bc0b62
Github actions - take 6
devdattakulkarni Jun 3, 2024
3d7e0e9
Github actions - take 7
devdattakulkarni Jun 3, 2024
df0b3c7
Github actions - trial 8
devdattakulkarni Jun 3, 2024
dee417f
Github actions - trial 9
devdattakulkarni Jun 3, 2024
b69a489
Github actions - trial 10
devdattakulkarni Jun 3, 2024
181688e
README update
devdattakulkarni Jun 3, 2024
35ef449
Merge branch 'master' into develop
devdattakulkarni Jun 4, 2024
1952e6f
Github actions update - running tests
devdattakulkarni Jun 4, 2024
7c3e246
Github actions - enabling detailed logs
devdattakulkarni Jun 4, 2024
af80362
Github action - Added sleep and enabling test output
devdattakulkarni Jun 4, 2024
b9a027b
Tests update
devdattakulkarni Jun 4, 2024
ce04dd5
Tests update
devdattakulkarni Jun 4, 2024
c60a03e
Github action - running tests
devdattakulkarni Jun 4, 2024
0beca73
Github action update - installing KubePlus chart from deploy dir
devdattakulkarni Jun 4, 2024
f81c66a
Github action update - installing KubePlus chart from deploy dir
devdattakulkarni Jun 4, 2024
f0c326c
Merge branch 'master' into develop
devdattakulkarni Jun 4, 2024
8b39592
Merge branch 'develop' of github.com:cloud-ark/kubeplus into develop
devdattakulkarni Jun 4, 2024
9d75c5b
Updates to helmer and tests
devdattakulkarni Jun 5, 2024
782fff0
KubePlus chart - 3.0.40
devdattakulkarni Jun 5, 2024
6493a81
Support for application force delete
devdattakulkarni Jun 6, 2024
2cf8401
Merge branch 'master' into develop
devdattakulkarni Jun 6, 2024
d474c4a
KubePlus chart update - 3.0.41
devdattakulkarni Jun 6, 2024
ae89314
Merge branch 'master' into develop
devdattakulkarni Jun 10, 2024
48a7897
README update - Referencing GitHub pages site
devdattakulkarni Jun 10, 2024
680538a
Updating import
devdattakulkarni Jun 11, 2024
85f3021
Merge branch 'master' into develop
devdattakulkarni Jun 11, 2024
0c60975
GitHub Action update
devdattakulkarni Jun 11, 2024
9be6cb7
GitHub action update
devdattakulkarni Jun 11, 2024
14c565d
GitHub action update
devdattakulkarni Jun 11, 2024
6d0717c
GitHub action update - take 4
devdattakulkarni Jun 11, 2024
27fd4c2
GitHub action update - take 5
devdattakulkarni Jun 11, 2024
e5f60ba
GitHub action update - take 6
devdattakulkarni Jun 12, 2024
d798544
GitHub action update - take 7
devdattakulkarni Jun 12, 2024
009001c
GitHub action update - take 8
devdattakulkarni Jun 12, 2024
ad4a657
GitHub action update - take 9
devdattakulkarni Jun 12, 2024
bde3617
GitHub action update - take 10
devdattakulkarni Jun 12, 2024
c4dfabf
GitHub action update - take 11
devdattakulkarni Jun 12, 2024
b07fd98
GitHub action update - take 12
devdattakulkarni Jun 12, 2024
156f16f
GitHub action update - take 13
devdattakulkarni Jun 12, 2024
bd4dc71
GitHub action update - take 14
devdattakulkarni Jun 12, 2024
7b8467f
Merge branch 'master' into develop
devdattakulkarni Jun 12, 2024
88cebd5
platform-operator updates
devdattakulkarni Jun 12, 2024
445ca2c
KubePlus chart - 3.0.42
devdattakulkarni Jun 12, 2024
5e138c7
Merge branch 'master' into develop
devdattakulkarni Jun 12, 2024
f08e7f8
Removing kubediscovery as submodule
devdattakulkarni Jun 12, 2024
87ca40b
Merge branch 'master' into develop
devdattakulkarni Jun 12, 2024
bdec5a8
Merge branch 'master' into develop
devdattakulkarni Jun 13, 2024
ac5606b
Added ephemeral-storage request to component containers
devdattakulkarni Jun 13, 2024
ffcb794
Merge branch 'master' into develop
devdattakulkarni Jun 16, 2024
3cfef41
Day2 operation example update
devdattakulkarni Jun 16, 2024
c222e72
Example updates
devdattakulkarni Jun 19, 2024
b5c485b
Examples update - cleanup
devdattakulkarni Jun 19, 2024
20b234d
Merge branch 'master' into develop
devdattakulkarni Jun 19, 2024
56bf569
Merge branch 'master' into develop
devdattakulkarni Jun 22, 2024
af51633
KubePlus chart update - version 3.0.44
devdattakulkarni Jun 22, 2024
65bdcfe
Merge branch 'master' into develop
devdattakulkarni Jul 25, 2024
66578a1
Ignoring Succeeded Pods when calculating num_of_not_running pods
devdattakulkarni Jul 25, 2024
8d858ca
Rejecting cr instance creation if previous NS is in Terminating state
devdattakulkarni Jul 25, 2024
71408e2
Merge branch 'master' into develop
devdattakulkarni Jul 25, 2024
15f457c
AdmissionResponse cannot be empty string
devdattakulkarni Jul 25, 2024
71d7f6d
Correctly checking if previous NS not in Terminating state
devdattakulkarni Jul 26, 2024
1039bc2
Merge branch 'master' into develop
devdattakulkarni Jul 26, 2024
fce2971
Merge branch 'master' into develop
devdattakulkarni Jul 26, 2024
55a2165
KubePlus chart - 3.0.45
devdattakulkarni Jul 26, 2024
3f9d5cb
WIP: Licensing support
devdattakulkarni Aug 2, 2024
dbd5e8f
Merge branch 'master' into develop
devdattakulkarni Aug 2, 2024
e41ec1b
License support - tests
devdattakulkarni Aug 3, 2024
6c4f032
License support - GH action typo fix
devdattakulkarni Aug 3, 2024
432f2de
License support - Test cleanup and README update
devdattakulkarni Aug 3, 2024
18f016a
License support - tests and README update
devdattakulkarni Aug 3, 2024
a5e62f8
License support - review feedback update
devdattakulkarni Aug 3, 2024
0d119a9
Merge branch 'master' into develop
devdattakulkarni Aug 3, 2024
a56456b
KubePlus chart - 3.0.46
devdattakulkarni Aug 3, 2024
f2719af
Merge branch 'master' into develop
devdattakulkarni Aug 6, 2024
9f238a8
Example update - hello-world
devdattakulkarni Aug 6, 2024
74be66b
Merge branch 'master' into develop
devdattakulkarni Aug 6, 2024
a133e94
Ensuring that app status field is correctly updated on app update
devdattakulkarni Aug 7, 2024
4f2cbe0
Ensuring app status field is correctly updated on status update
devdattakulkarni 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
31 changes: 18 additions & 13 deletions platform-operator/helm-pod/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -944,15 +944,16 @@ func deployChart(request *restful.Request, response *restful.Response) {
// Install the Helm chart in the namespace that is created for that instance
helmInstallCmd := "helm install " + releaseName + " ./" + parsedChartName + " -f " + overRidesFile + " -n " + targetNSName
fmt.Printf("ABC helm install cmd:%s\n", helmInstallCmd)
go runHelmInstall(cmdRunnerPod, helmInstallCmd, releaseName, kind, group, version, plural, customresource, crObjNamespace, targetNSName, cpu_req, cpu_lim, mem_req, mem_lim)
go runHelmInstallUpgrade(cmdRunnerPod, "install", helmInstallCmd, releaseName, kind, group, version, plural, customresource, crObjNamespace, targetNSName, cpu_req, cpu_lim, mem_req, mem_lim)
}

if doHelmUpgrade {
helmUpgradeCmd := "helm upgrade " + releaseName + " ./" + parsedChartName + " -f " + overRidesFile + " -n " + targetNSName
fmt.Printf("ABC helm upgrade cmd:%s\n", helmUpgradeCmd)
go runHelmInstallUpgrade(cmdRunnerPod, "upgrade", helmUpgradeCmd, releaseName, kind, group, version, plural, customresource, crObjNamespace, targetNSName, cpu_req, cpu_lim, mem_req, mem_lim)

_, helmUpgradeOutput := executeExecCall(cmdRunnerPod, helmUpgradeCmd)
fmt.Printf("Helm upgrade o/p:%v\n", helmUpgradeOutput)
//_, helmUpgradeOutput := executeExecCall(cmdRunnerPod, helmUpgradeCmd)
//fmt.Printf("Helm upgrade o/p:%v\n", helmUpgradeOutput)
}
}

Expand Down Expand Up @@ -994,7 +995,7 @@ func deployChart(request *restful.Request, response *restful.Response) {
response.Write([]byte(string("")))
}

func runHelmInstall(cmdRunnerPod, helmInstallCmd, releaseNameInCmd, kind, group, version, plural, customresource, crObjNamespace, targetNSName, cpu_req, cpu_lim, mem_req, mem_lim string) {
func runHelmInstallUpgrade(cmdRunnerPod, cmd, helmInstallCmd, releaseNameInCmd, kind, group, version, plural, customresource, crObjNamespace, targetNSName, cpu_req, cpu_lim, mem_req, mem_lim string) {

ok, execOutput := executeExecCall(cmdRunnerPod, helmInstallCmd)
if ok {
Expand Down Expand Up @@ -1028,20 +1029,24 @@ func runHelmInstall(cmdRunnerPod, helmInstallCmd, releaseNameInCmd, kind, group,
if releaseFound {
//statusToUpdate := releaseName + "\n" + notes
go updateStatus(kind, group, version, plural, customresource, crObjNamespace, targetNSName, releaseName, notes)
if (cpu_req != "" && cpu_lim != "" && mem_req != "" && mem_lim != "") {
go createResourceQuota(targetNSName, releaseName, cpu_req, cpu_lim, mem_req, mem_lim)
if cmd == "install" {
if (cpu_req != "" && cpu_lim != "" && mem_req != "" && mem_lim != "") {
go createResourceQuota(targetNSName, releaseName, cpu_req, cpu_lim, mem_req, mem_lim)
}
go createNetworkPolicy(targetNSName, releaseName)
}
go createNetworkPolicy(targetNSName, releaseName)
}
} else {
//statusToUpdate := releaseNameInCmd + "\n" + execOutput
go updateStatus(kind, group, version, plural, customresource, crObjNamespace, targetNSName, releaseNameInCmd, execOutput)
errOp := string(execOutput)
instanceExists := strings.Contains(errOp, "cannot re-use a name that is still in use")
if !instanceExists {
deleteNSCmd := "./root/kubectl delete ns " + customresource
_, execOutput1 := executeExecCall(cmdRunnerPod, deleteNSCmd)
fmt.Printf("Output of delete NS Cmd:%v\n", execOutput1)
if cmd == "install" {
errOp := string(execOutput)
instanceExists := strings.Contains(errOp, "cannot re-use a name that is still in use")
if !instanceExists {
deleteNSCmd := "./root/kubectl delete ns " + customresource
_, execOutput1 := executeExecCall(cmdRunnerPod, deleteNSCmd)
fmt.Printf("Output of delete NS Cmd:%v\n", execOutput1)
}
}
// there was some error
/*response.Write([]byte(string(execOutput)))*/
Expand Down
1 change: 1 addition & 0 deletions platform-operator/helm-pod/versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
3.0.19
3.0.20
3.0.21
3.0.22
33 changes: 9 additions & 24 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,6 @@ def test_license_plugin(self):
cmd = "kubectl create -f ../examples/multitenancy/hello-world/hs1.yaml --kubeconfig=../kubeplus-saas-provider.json"
TestKubePlus.run_command(cmd)

all_running = False
cmd = "kubectl get pods -n hs1"

target_pod_count = 1
pods, count, all_running = self._check_pod_status(cmd, target_pod_count)
if count == target_pod_count:
self.assertTrue(True)
else:
self.assertTrue(False)

# Second instance creation should be denied
cmd = "kubectl create -f ../examples/multitenancy/hello-world/hs2.yaml --kubeconfig=../kubeplus-saas-provider.json"
out, err = TestKubePlus.run_command(cmd)
Expand Down Expand Up @@ -198,7 +188,8 @@ def test_application_update(self):
else:
self.assertTrue(False)

cmd = "kubectl apply -f ../examples/multitenancy/hello-world/hs1-replicas-2.yaml --kubeconfig=../kubeplus-saas-provider.json"
time.sleep(10)
cmd = "kubectl replace -f ../examples/multitenancy/hello-world/hs1-replicas-2.yaml --kubeconfig=../kubeplus-saas-provider.json"
TestKubePlus.run_command(cmd)
all_running = False
cmd = "kubectl get pods -n hs1"
Expand All @@ -210,6 +201,7 @@ def test_application_update(self):
else:
self.assertTrue(False)

time.sleep(10)
cmd = "kubectl delete -f ../examples/multitenancy/hello-world/hs1-replicas-2.yaml --kubeconfig=../kubeplus-saas-provider.json"
TestKubePlus.run_command(cmd)

Expand Down Expand Up @@ -327,11 +319,15 @@ def cleanup():
name = part.strip()
break

print("Pod name:" + name)
if name == None:
print("Pod did not come up even after waiting " + str(wait_time) + " seconds.")
print("Skipping rest of the test.")
cmd = "kubectl label WebAppService bwa-tenant1 delete=true"
TestKubePlus.run_command(cmd)
cmd1 = "kubectl delete -f ./application-upgrade/tenant1.yaml --kubeconfig=./application-upgrade/provider.conf"
TestKubePlus.run_command(cmd)
cleanup()
return

# port forwarding
# CLI: kubectl port-forward pod-name -n bwa-tenant1 5000:5000
Expand Down Expand Up @@ -451,17 +447,6 @@ def test_force_delete_application(self):
cmd = "kubectl create -f tenant1.yaml --kubeconfig=../kubeplus-saas-provider.json"
TestKubePlus.run_command(cmd)

cmd = "kubectl delete -f tenant1.yaml --kubeconfig=../kubeplus-saas-provider.json"
out, err = TestKubePlus.run_command(cmd)
# print("Out:" + out)
# print("Err:" + err)
self.assertTrue("Custom Resource instance cannot be deleted. It is not ready yet." in err)

cmd = "kubectl delete -f wordpress-service-composition-chart-nopodpolicies.yaml --kubeconfig=../kubeplus-saas-provider.json"
out, err = TestKubePlus.run_command(cmd)
self.assertTrue(
"ResourceComposition instance cannot be deleted. It has an application instance starting up." in err)

cmd = "kubectl label WordpressService tenant1 delete=true"
TestKubePlus.run_command(cmd)

Expand Down Expand Up @@ -585,7 +570,7 @@ def cleanup():
# asserts
lines = out.split('\n')
self.assertTrue('Deployed' in lines[1])
self.assertTrue('Running' in lines[2])
self.assertTrue('Running' in lines[2] or 'Pending' in lines[2] or 'ContainerCreating' in lines[2])

cleanup()
# TODO: Add tests for
Expand Down
Loading