Skip to content

Comments

#BE-4705 Docker to K8s Migration Documentation#802

Open
burakberkkeskin wants to merge 42 commits intodevelopfrom
feature/BE-4705
Open

#BE-4705 Docker to K8s Migration Documentation#802
burakberkkeskin wants to merge 42 commits intodevelopfrom
feature/BE-4705

Conversation

@burakberkkeskin
Copy link
Contributor

No description provided.

@burakberkkeskin burakberkkeskin self-assigned this Jan 14, 2025
@netlify
Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for reverent-galileo-8ef035 ready!

Name Link
🔨 Latest commit 4242dda
🔍 Latest deploy log https://app.netlify.com/sites/reverent-galileo-8ef035/deploys/67caed3d21ae910008b1e3e3
😎 Deploy Preview https://deploy-preview-802--reverent-galileo-8ef035.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@burakberkkeskin burakberkkeskin changed the title #BE-4705 Docker to K8s Documentation #BE-4705 Docker to K8s Migration Documentation Jan 14, 2025
```

- **User Secrets:**
Decode and print the `user-secret.yaml` file and save it on the bastion host:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Decode and print the `user-secret.yaml` file and save it on the bastion host:
Decode and print the `user-secret` file and save it on the bastion host:

- **Check the MinIO data size:**

```bash
echo "$APPCIRCLE_DISK_USAGE" | grep "snsd_data"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "$APPCIRCLE_DISK_USAGE" | grep "snsd_data"
echo "$APPCIRCLE_DISK_USAGE" | grep "spacetech_snsd_data"

- **Check the MongoDB data size:**

```bash
echo "$APPCIRCLE_DISK_USAGE" | grep "mongo_data"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "$APPCIRCLE_DISK_USAGE" | grep "mongo_data"
echo "$APPCIRCLE_DISK_USAGE" | grep "spacetech_mongo_data"


- **Check the Vault data size:**
```bash
echo "$APPCIRCLE_DISK_USAGE" | grep "vault_data"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "$APPCIRCLE_DISK_USAGE" | grep "vault_data"
echo "$APPCIRCLE_DISK_USAGE" | grep "spacetech_vault_data"

- **Shift DNS to the New Cluster:**
Update the DNS records to point to the new Appcircle Kubernetes cluster.

- **Redis Subdomain Change:**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step is optional. If user changes redis to kvs that he/she needs to update runner appsettings.json with the changed URL and restart runners.

If not, then no need runner maintenance.


After reviewing the key considerations, follow the [Appcircle Server Kubernetes Installation Guide](https://docs.appcircle.io/self-hosted-appcircle/install-server/helm-chart/installation/kubernetes) for detailed Appcircle server Helm chart deployment instructions.

#### 2. Key Considerations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "DNS section" that user should keep existing domains for the migration.


## Overview

This guide provides a step-by-step walkthrough for migrating your self-hosted **Appcircle** instance from a standalone Docker environment to a Kubernetes cluster. It assumes that you already have:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add general caution about user should change any configuration while migration (for instance, SMTP etc.) it's unsupported

If user needs change: first it should migrate successfully then make configuration change using the relevant configuration documentation page.


- Refer to the [Storage Configuration](https://docs.appcircle.io/self-hosted-appcircle/install-server/helm-chart/configuration/storage-configuration) page for detailed instructions.

- **Prepare `values.yaml` for Migration:**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add disclaimer text that all customized global.yaml settings should be mapped by user to values.yaml by looking at the Kubernetes configuration pages.


**Helm version `3.11.0`** or later is **required**.

### 6. Bastion Host
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"4. Kubectl" and "5. Helm v3" should be subtitles of the "6. Bastion Host" section.


The bastion host should meet the following requirements to facilitate the migration from the standalone Appcircle server to the Kubernetes Appcircle server:

- **SSH Access**: The bastion host must have SSH access to the standalone Appcircle server.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title revision: "Standalone Appcircle server access" instead of "SSH access"

```

#### 3. Check the Data Size on the Standalone Appcircle Server

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add <SpacetechExampleInfo/> into this section since we can jump here from Bastion requirements.

- **Check the MinIO data size:**

```bash
echo "$APPCIRCLE_DISK_USAGE" | grep "spacetech_snsd_data"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "$APPCIRCLE_DISK_USAGE" | grep "spacetech_snsd_data"
echo "$APPCIRCLE_DISK_USAGE" | grep "spacetech_minio_snsd_data"

- **Check the MongoDB data size:**

```bash
echo "$APPCIRCLE_DISK_USAGE" | grep "spacetech_mongo_data"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "$APPCIRCLE_DISK_USAGE" | grep "spacetech_mongo_data"
echo "$APPCIRCLE_DISK_USAGE" | grep "spacetech_mongo_data1"

kubectl create namespace appcircle
```

### 4. Create Container Registry Secret
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section should be moved after "Create Kubernetes Secrets".


#### 5. Update the Standalone Appcircle Server to the Latest Version

Before migrating to Kubernetes Appcircle server, please [update the standalone Appcircle server](https://docs.appcircle.io/self-hosted-appcircle/install-server/linux-package/update) to the latest version.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migration is supported for 3.23.2 or later Appcircle servers.

If that's OK, then user should select a helm chart latest version that's compatible with his/her standalone server.

We should have link to chart/app version history.


**Please adjust these values** according to your environment requirements and **save your file**.

In the example values below, we used `spacetech` as an **example organization name**. You should **replace it** with your actual organization name or any other value you prefer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a "danger" box that tells user not to change any setting in global yaml and use them as-is.

6. For the organization ID, filter the `userinfo` request.
7. In the response, check for `currentOrganizationId`.

<Screenshot url='https://cdn.appcircle.io/docs/assets/BE-4705-organization-page.png' />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove UI steps with the command below for "organization ıd"

  • cat generated-secret.yaml | grep -i organization

Organization will be got from UI but fewer steps.

Copy link
Contributor

@csonuryilmaz csonuryilmaz Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Organization name might be optional but we're not sure now. Testing...

We decided not to remove organization name for now. It's SS is up-to-date.

  • Blur team members in the SS.

- **No new DNS record is required**.
- **Appcircle runners do not need to be updated**.

#### **Additional Updates**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before additional updates section, we should mention about SSL configuration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSL configuration page should have notice that warns user about the last might not be rootCA in all cases. For example Lets Encrypt case.

### 2. SSL Certificate

If the **standalone Appcircle server** is already using **HTTPS**, you **should provide an SSL certificate** for the Appcircle server Kubernetes deployment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add "tip" box that tells user that he/she can re-use the standalone server certificates for K8s and can get them from standalone server configuration file. (i.e., global.yaml)

- **Standalone Appcircle server access**: The bastion host should have SSH access to the standalone Appcircle server.
- **Kubernetes Access**: The bastion host should be able to access the Kubernetes cluster API with `kubectl` for deploying Appcircle server.

- **Tools**: The tools below are required for the migration:
Copy link
Contributor

@csonuryilmaz csonuryilmaz Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Since we moved these requirements to upper sections, we should remove duplicate here.


#### **Keycloak Updates**

Ensure the `organizationName` and `initialOrganizationId` in the `values.yaml` file match those in the standalone Appcircle server.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • organization name should be got from UI before we stop Nginx. For this reason, this section (or requirement) should be moved under "standalone appcircle server steps" before step 6.


- **Create a namespace:**

For the Appcircle server deployment. In this documentation, we will use `appcircle` as the example namespace.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • We should move this section to "installation" steps before step 4

To make sure that the stateful apps are ready for migration, you can run the command below and wait for `The databases are ready for migration steps.` output.

```bash
kubectl wait --for=condition=Ready pod -l 'app.kubernetes.io/name=auth-postgresql' --timeout=300s && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • We should add "namespace" to the commands here

n # Create a new remote
name> ac-standalone # Provide a descriptive name for the remote
Storage> 4 # Select "Amazon S3 Compliant Storage Provider" (4)
provider> 7 # Select "Minio Object Storage" (7)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Use "Minio" instead of "MinIO" for the tool naming

n # Create a new remote
name> ac-k8s # Provide a descriptive name for the remote
Storage> 4 # Select "Amazon S3 Compliant Storage Provider" (4)
provider> 7 # Select "Minio Object Storage" (7)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Use "Minio" instead of "MinIO" for the tool naming

Storage> 4 # Select "Amazon S3 Compliant Storage Provider" (4)
provider> 7 # Select "Minio Object Storage" (7)
env_auth> "false" # Set environment authentication to "false"
access_key_id> <access_key> # Enter the standalone Appcircle server's access key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This section has "standalone" words in the comments that must be replaced with "K8s" side

2. **Change directory to appcircle-server:**

```bash
cd appcircle-server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It will be better to use "appcircle-k8s-migration" folder here

7. **Open shell in the vault container:**

```bash
kubectl exec -it appcircle-server-vault-0 -- bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • we need to add namespace to this command

Delete the `replicas: 0` setting under `auth-keycloak`.

- **Remove MongoDB Resource Preset:**
Delete the `resourcesPreset` setting under `mongodb` if you don't need it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add info about possible values that can be used as resourcesPreset for different needs

```bash
kubectl rollout restart deployment -n appcircle
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add below command to refresh vault which prevents vault connection refused cases
kubectl delete pod appcircle-server-vault-0 -n appcircle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants