Stronghold EE can be upgraded to Stronghold CSE in one of the following ways:
- in a standalone installation;
- in a DP installation.
Upgrading from Stronghold EE 1.15.x to Stronghold CSE 1.16.0 is supported. If you use a Stronghold EE version earlier than 1.15.x, first update to the latest version of the branch.
The service may be temporarily unavailable during the upgrade to Stronghold CSE.
Upgrading in a DP installation
This section describes the upgrade of the stronghold module in a DP cluster.
Switching to Stronghold CSE requires Deckhouse Platform Certified Security Edition (DP CSE) version 1.73 or later.
Before starting the upgrade, do the following:
Check the current Stronghold version. The pod labels contain the version with the edition suffix:
d8 k -n d8-stronghold get pod -o yaml | grep versionSave the unseal keys and the root token to a secure storage. Example:
d8 k -n d8-stronghold get secret stronghold-keys -o yaml > stronghold-keys.yaml chmod 600 stronghold-keys.yamlCreate a backup or a snapshot of the Stronghold cluster. Example:
export STRONGHOLD_ADDR=https://$(d8 k -n d8-stronghold get ing stronghold -o json | jq -r '.spec.rules[0].host') d8 stronghold login -method=oidc -path=oidc_deckhouse # To log in with the root token instead, run the following command. # d8 stronghold login -method=token d8 stronghold operator raft snapshot save stronghold-$(date +%F_%H-%M).snapYou can check the snapshot with the following command:
ls -lh ./stronghold-*.snapStore the resulting files outside the DP cluster.
Make sure the
strongholdModuleConfig exists:d8 k get mc stronghold -o yamlIf the ModuleConfig does not exist, create it:
d8 k apply -f - <<EOF apiVersion: deckhouse.io/v1alpha1 kind: ModuleConfig metadata: name: stronghold spec: enabled: false EOF
Disabling automatic module updates
To disable automatic module updates, do the following:
Determine the current release channel of the
strongholdmodule:d8 k get module stronghold -o jsonpath='{.properties.releaseChannel}'If the command outputs nothing, use the
stablechannel in the next step.Create a ModuleUpdatePolicy with the manual update mode, specifying the current release channel in the
releaseChannelfield, and apply it:cat <<EOF > stronghold-mup.yaml apiVersion: deckhouse.io/v1alpha2 kind: ModuleUpdatePolicy metadata: name: stronghold-update-policy spec: releaseChannel: <STRONGHOLD_RELEASE_CHANNEL> update: mode: Manual EOF d8 k apply -f stronghold-mup.yaml d8 k get mup stronghold-update-policyExpected output:
NAME RELEASE CHANNEL UPDATE MODE stronghold-update-policy Stable ManualSpecify the created ModuleUpdatePolicy in the
strongholdModuleConfig:d8 k patch moduleconfig stronghold --type merge --patch '{"spec":{"updatePolicy":"stronghold-update-policy"}}'Check that the value has been saved:
d8 k get mc stronghold -o jsonpath='{.spec.updatePolicy}'Expected output:
stronghold-update-policyMake sure the changes have been applied to the
strongholdmodule:d8 k get module stronghold -o jsonpath='{.properties.updatePolicy}'Expected output:
stronghold-update-policyIf DP CSE 1.67 or earlier is used, or if the module has never been started, the command output is empty. No additional actions are required in this case.
Pre-upgrade checks
Before the upgrade, check the DP cluster and the stronghold module:
Check the DP version. Switching to Stronghold CSE requires DP CSE version 1.73 or later. You can check the DP version with the following command:
d8 k -n d8-system get configmap d8-deckhouse-version-info -o yamlYou can also check the DP version in the Deckhouse web interface on the main page of the cluster management console (
https://console.<CLUSTER_DOMAIN>).If you need to update DP or switch its edition, use the following instructions: - DP update instructions; - instructions for switching DP EE to DP CSE.
Make sure DP is working normally, the leader node is determined, and the queue is empty:
d8 k -n d8-system get deploy deckhouse d8 k -n d8-system get pod -l leader=true d8 system queue listExpected output:
The
deckhouseDeployment isReady:NAME READY UP-TO-DATE AVAILABLE AGE deckhouse 3/3 3 3 1dThere is a working pod in the
Runningstatus:NAME READY STATUS RESTARTS AGE deckhouse-596d944f95-d82m8 2/2 Running 0 1dThe task queue is empty:
Summary: - 'main' queue: empty. - 121 other queues (0 active, 121 empty): 0 tasks. - no tasks to handle.
Make sure the
strongholdmodule is enabled and working:d8 k get module stronghold d8 k get moduleconfig stronghold -o yamlCheck that:
EnabledandReadyareTrueforstronghold;- the
strongholdModuleConfig object exists; - a license key is specified in
spec.settings.license.
Make sure Stronghold EE version 1.15.x is used. You can do this in one of the following ways:
In the Deckhouse web interface: open the main page of the cluster management console (
https://console.<CLUSTER_DOMAIN>) and check that version 1.15.x with theeesuffix is shown at the bottom of the page.Using the pod manifest or image. To do this, run the command:
d8 k -n d8-stronghold get pod -o yaml | grep versionThe pod labels must contain version 1.15.x with the
eesuffix.Using the logs. To do this, run the command:
d8 k -n d8-stronghold logs stronghold-0 | head -20The startup banner lines must contain the version with the edition:
Version: Stronghold v1.15.0+ee
Preparing the module for installation
Upload Stronghold CSE to your image registry and connect the registry to the cluster:
Prepare Stronghold CSE in your image registry (performed on a machine that can push images to the registry). Verify the archive checksum and push the Stronghold CSE module bundle:
# Verify the archive checksum: gost12sum module-stronghold.tar # Move the archive to the modules directory: mkdir modules mv module-stronghold.tar modules/. # Image registry host address. For example, 10.129.0.18:5000 or my-registry.com. export REGISTRY_HOST="<REGISTRY_HOST>" # DP image registry address. For example, 10.129.0.18:5000/dkp-cse/stable. export MODULES_MODULE_REPO="${REGISTRY_HOST}/<PATH_TO_DKP_REPO>" # Use an account with write permissions to the image registry. d8 mirror push modules $MODULES_MODULE_REPO -u <USERNAME> -p <PASSWORD>Create a ModuleSource for Stronghold CSE. Using your infrastructure tools, make sure the image registry is reachable from each master node. Prepare and apply the ModuleSource:
# Path to the modules in the image registry. MODULES_MODULE_SOURCE="$MODULES_MODULE_REPO/modules" # Name of a user with read access to images. REGISTRY_USER="<REGISTRY_USER>" # User password. REGISTRY_PASSWORD="<REGISTRY_PASSWORD>" # CA certificate of the domain used for the image registry. REGISTRY_CA_CERT="<CA_CERT_FOR_REGISTRY>" AUTH_STRING=$(echo -n "${REGISTRY_USER}:${REGISTRY_PASSWORD}" | base64) DOCKER_CFG=$(echo -n '{"auths":{"'${REGISTRY_HOST}'":{"username":"'${REGISTRY_USER}'","password":"'${REGISTRY_PASSWORD}'","auth":"'${AUTH_STRING}'"}}}' | base64 -w0) cat <<EOF > stronghold-cse-ms.yaml apiVersion: deckhouse.io/v1alpha1 kind: ModuleSource metadata: name: stronghold-cse spec: registry: ca: "$REGISTRY_CA_CERT" dockerCfg: $DOCKER_CFG repo: $MODULES_MODULE_SOURCE scheme: HTTPS EOF # Check the configuration. cat stronghold-cse-ms.yaml # Apply the resource. d8 k apply -f stronghold-cse-ms.yamlCheck the ModuleSource status:
d8 k get modulesource stronghold-cse -o yamlCheck that there are no errors in the status and that the
status.messagefield is empty:... status: message: "" ...
Switching the Stronghold module from EE to CSE
Update the stronghold ModuleConfig to use the new ModuleSource:
Check that the
strongholdModuleConfig exists:d8 k get mc stronghold -o yamlAdd the
spec.sourcefield with thestronghold-csevalue to the ModuleConfig:d8 k patch moduleconfig stronghold --type merge --patch '{"spec":{"source":"stronghold-cse"}}' d8 k get moduleconfig stronghold -o yamlCheck that the changes have been applied:
- the
strongholdModuleConfig containsspec.source: stronghold-cse; - the other fields in
spec.settingshave not changed.
- the
If the module reports a license problem after switching the source, update only the license field (
CSE_LICENSE):d8 k patch moduleconfig stronghold --type merge --patch '{"spec":{"settings":{"license":"<CSE_LICENSE>"},"version":1}}'If the module was previously disabled, enable it:
d8 system module enable strongholdWait until DP stabilizes and the queue is empty:
d8 k -n d8-system get pods -l app=deckhouse d8 system queue listCheck that:
- the
deckhousepod isRunning/Ready; - the queue is empty.
- the
Switch the ModuleUpdatePolicy to the AutoPatch mode:
Change the update mode:
d8 k patch mup stronghold-update-policy --type merge --patch '{"spec":{"update":{"mode":"AutoPatch"}}}'Check that the update mode has changed:
d8 k get mup stronghold-update-policyExpected output:
NAME RELEASE CHANNEL UPDATE MODE stronghold-update-policy Stable AutoPatch
Verify that the switch to CSE is complete:
Check the module state:
d8 k get modules strongholdExpected output:
NAME STAGE SOURCE PHASE ENABLED READY stronghold General Availability stronghold-cse Ready True TrueCheck the module source:
d8 k get modulesource stronghold-cse -o yaml d8 k get moduleconfig stronghold -o yaml d8 k get module stronghold -o yamlCheck that:
- there are no
auth,tls,x509, ortimeouterrors; - there are no warning events;
- the
strongholdModuleConfig containsspec.source: stronghold-cse; - the
strongholdModule containsproperties.source: stronghold-cse.
- there are no
Check the
strongholdpods:d8 k -n d8-stronghold get poCheck that:
- there are no
ImagePullBackOff,ErrImagePull, orCrashLoopBackOffstates; - the
stronghold-*pods are in theRunningstate with2/2readiness.
- there are no
Alternative: installing a new cluster of the required version
If you could not pass the pre-upgrade checks, that is, bring the current DP cluster and the stronghold module to the required versions (DP CSE 1.73 or later and Stronghold EE 1.15.x), you can move the Stronghold cluster to a new DP CSE 1.73 cluster by restoring a backup.
To do this, follow these steps:
Deploy a DP CSE 1.73 cluster.
Starting from the Disabling automatic module updates section, perform all the steps on the new cluster in order.
Restore the backup, the unseal keys, and the root token. Run the commands on the host where the
stronghold-*.snapbackup files and thestronghold-keys.yamlkeys are located. Example of restoring a Stronghold cluster backup:Restore the snapshot:
export STRONGHOLD_ADDR=https://$(d8 k -n d8-stronghold get ing stronghold -o json | jq -r '.spec.rules[0].host') d8 stronghold login -method=oidc -path=oidc_deckhouse # To log in with the root token instead, run the following command. # d8 stronghold login -method=token d8 stronghold operator raft snapshot restore -force stronghold-<SNAPSHOT_DATE>.snapRestore the unseal keys and the root token:
d8 k -n d8-stronghold delete secret stronghold-keys d8 k -n d8-stronghold create -f stronghold-keys.yamlCheck the
strongholdpods:d8 k -n d8-stronghold get poCheck that:
- there are no
ImagePullBackOff,ErrImagePull, orCrashLoopBackOffstates; - the
stronghold-*pods are in theRunningstate with2/2readiness.
- there are no