-
Notifications
You must be signed in to change notification settings - Fork 18
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
Kubernetes refactoring #450
base: main
Are you sure you want to change the base?
Commits on Oct 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for bf79ce7 - Browse repository at this point
Copy the full SHA bf79ce7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a1b611 - Browse repository at this point
Copy the full SHA 8a1b611View commit details -
Configuration menu - View commit details
-
Copy full SHA for cd6371b - Browse repository at this point
Copy the full SHA cd6371bView commit details -
Configuration menu - View commit details
-
Copy full SHA for ed5b4bc - Browse repository at this point
Copy the full SHA ed5b4bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a27022 - Browse repository at this point
Copy the full SHA 2a27022View commit details -
Rename test_utils to testutils
stylecheck reports that modules should not have underscore in their names: rename test_utils to fix this. Rule ST1003. Note that mixed caps are not allowed in module names either.
Configuration menu - View commit details
-
Copy full SHA for 7a45e62 - Browse repository at this point
Copy the full SHA 7a45e62View commit details -
Rename flags_tests to flagstests
stylecheck reports that modules should not have underscore in their names: rename flags_tests to fix this. Rule ST1003. Note that mixed caps are not allowed in module names either.
Configuration menu - View commit details
-
Copy full SHA for 2899af3 - Browse repository at this point
Copy the full SHA 2899af3View commit details -
Configuration menu - View commit details
-
Copy full SHA for aa9e5a5 - Browse repository at this point
Copy the full SHA aa9e5a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 53445e2 - Browse repository at this point
Copy the full SHA 53445e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for a60c3cb - Browse repository at this point
Copy the full SHA a60c3cbView commit details -
Use testing.T.TempDir instead of home made version
Since the testing module provides a TempDir function, use it in our tests. This also removes a number of errcheck errors about unchecked error in defer.
Configuration menu - View commit details
-
Copy full SHA for 801c111 - Browse repository at this point
Copy the full SHA 801c111View commit details -
Add a cleaner function return to TempDir()
Returning the function cleaning the temporary folder from its creation function factorizes the removal and removes the missing checks for the os.RemoveAll() error.
Configuration menu - View commit details
-
Copy full SHA for 8a81f7f - Browse repository at this point
Copy the full SHA 8a81f7fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e3bd722 - Browse repository at this point
Copy the full SHA e3bd722View commit details -
Backup the pgsql data after rsyncing them
During a migration to kubernetes the server is deployed after the rsync to prepare the SSL secrets and PVC. This has the nasty effect to corrupt the synchronized data with a too recent catalog version ID. This would let the DB migration to fail starting the old postgresql server. To workaround this, move the data to the the backup place after the rsync instead of the begining of the db upgrade.
Configuration menu - View commit details
-
Copy full SHA for e5b67fa - Browse repository at this point
Copy the full SHA e5b67faView commit details -
Refresh the connection after the k8s migration
After the k8s migration the pod has been started again since the initial connection creation. We need to reset the connection to not search for the old pod name.
Configuration menu - View commit details
-
Copy full SHA for 1aea41a - Browse repository at this point
Copy the full SHA 1aea41aView commit details -
Wait for 3 hours when running a pod
Some pods require a long time to run. This is the case for the DB upgrade finalization that runs a potentially long reindex.
Configuration menu - View commit details
-
Copy full SHA for 4da77bb - Browse repository at this point
Copy the full SHA 4da77bbView commit details -
Add deployments reason for helm history
Migration deploys the helm chart multiple times. Identifying which revision corresponds to which step in helm history is hard without a description.
Configuration menu - View commit details
-
Copy full SHA for 9481f86 - Browse repository at this point
Copy the full SHA 9481f86View commit details -
Configuration menu - View commit details
-
Copy full SHA for c80db2b - Browse repository at this point
Copy the full SHA c80db2bView commit details -
Fix the SUSE Manager version inspection before release
During the development process the susemanager-release file appends a string like `Alpha1` to the version. The inspection sed command chokes on this.
Configuration menu - View commit details
-
Copy full SHA for 3544beb - Browse repository at this point
Copy the full SHA 3544bebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0873e12 - Browse repository at this point
Copy the full SHA 0873e12View commit details -
Reorganize the kubernetes SSL CA deployment code for readability
Of of the issuers creation function had two distinct behaviors and this was only generating confusion when reading the whole code. This function has been split and some useless intermediary functions have been merged. This with better function naming should make the SSL setup code more understandable.
Configuration menu - View commit details
-
Copy full SHA for f225986 - Browse repository at this point
Copy the full SHA f225986View commit details -
Ports internal data description refactoring
In the kubernetes world we need to link the ports to services. For now we only have a TCP and an UDP service for server and the same for proxy, but in the short term, we will need more services to allow splitting into multiple pods. This refactoring is preparing this split.
Configuration menu - View commit details
-
Copy full SHA for 665015a - Browse repository at this point
Copy the full SHA 665015aView commit details -
Configuration menu - View commit details
-
Copy full SHA for e07ce66 - Browse repository at this point
Copy the full SHA e07ce66View commit details -
Refactor the upgrade SanityCheck to not exec in a running container
Running commands in a running container only works if there is a running container and is harder to unit test. In order to help sharing code for Kubernetes, the SanityCheck now gets the existing deployment version with inspecting its image. This also helps adding unit tests for those checks.
Configuration menu - View commit details
-
Copy full SHA for 1937169 - Browse repository at this point
Copy the full SHA 1937169View commit details -
Use one data structure for install, migrate, upgrade flags
In order to later share code between those 3 very similar commands, we need to share the parameters data structure.
Configuration menu - View commit details
-
Copy full SHA for 4f336ab - Browse repository at this point
Copy the full SHA 4f336abView commit details -
Kubernetes migration refactoring
Migration to kubernetes is rather fragile, with: 1. tasks running in `kubectl exec` or as `pod`. 2. the uyuni helm chart being deployed multiple times 3. `hostPath` mounts are used everywhere for the scripts to run and data to read and force the script to run on the cluster node. Here are the solutions to those problems: 1. Each step will run as a Job and those won't be deleted automatically for the user to access their logs after. 2. Stop using the helm chart and deploy the resources when we need them. This will allow more control of what runs when and reduces the number of useless starts of the giant container. Postgresql DB upgrade will disable SSL temporarily in the postgresql.conf in order to not rely on the SSL certificates to be migrated. 3. The scripts to run for each step will be passed directly as `sh -c` parameter to the generated Jobs. The migration data are be stored in a special volume and not on the host. As a collateral, SSH agent can no longer be used as that would require running on a cluster node again. At the moment the user is required to create a ConfigMap to stored the SSH config and known_hosts and a Secret for a passwordless SSH key. The PersistentVolumes are not destroyed after the end of the first job and are then reused by the next ones and the final deployment. Using Kubernetes API modules also helps for code reuse with a future operator. However for this `kubectl` should be dropped completely in favor of the official go client, but that could come in a future PR. As a side effect kubernetes interactions would be easier to mock for unit tests. Note that the old postgresql database cannot be moved to a separate PersistentVolumes. As we run a `db_upgrade --link`, the old database is linked by the new one and cannot be disposed of.
Configuration menu - View commit details
-
Copy full SHA for 75e8416 - Browse repository at this point
Copy the full SHA 75e8416View commit details -
Configuration menu - View commit details
-
Copy full SHA for f2674b3 - Browse repository at this point
Copy the full SHA f2674b3View commit details -
Remove all server resources without relying on the helm chart.
Configuration menu - View commit details
-
Copy full SHA for b963ef7 - Browse repository at this point
Copy the full SHA b963ef7View commit details -
Move the RunSetup function to shared
In order to share the same code for installation, migration and upgrade the RunSetup() function needs to move to the shared utils module.
Configuration menu - View commit details
-
Copy full SHA for 9b3adf7 - Browse repository at this point
Copy the full SHA 9b3adf7View commit details -
Configuration menu - View commit details
-
Copy full SHA for ffc6888 - Browse repository at this point
Copy the full SHA ffc6888View commit details