Online Manual Deployment of openFuyao-system-controller
Background
This document describes how to manually prepare patch-config, render, and deploy openFuyao-system-controller in an online scenario within a Kubernetes environment where openFuyao-system-controller has not been automatically deployed via BKE, thereby bringing up the openFuyao management plane components.
In the online scenario, openFuyao-system-controller and management plane components pull images directly from the online image registry and pull Charts from the online Helm repository.
Prerequisites
The following machines have been prepared:
| Role | Example IP | Purpose |
|---|---|---|
| Business cluster node | 192.168.200.216 | An existing Kubernetes cluster where openFuyao-system-controller is manually deployed and the management plane is brought up |
For machine hardware configuration, refer to the requirements in Quick Start.
The following information has been prepared:
| Information | Purpose | Preparation Method |
|---|---|---|
openFuyao-system-controller.yaml | Deploy the business cluster controller component | Copied and rendered from the local template directory in Section 3 later |
VersionConfig-v26.09.yaml | Component version configuration used for v26.09 version installation | This example reads from /bke/mount/source_registry/files/patches/VersionConfig-v26.09.yaml |
Note:
This document uses thev26.09version as an example. You can confirm the current version via the version configuration file: if you are usingVersionConfig-v26.09.yamland theopenFuyaoVersionfield in the file isv26.09, then it is thev26.09version; if you are using another version configuration file, then it is the corresponding version. For other versions, replace the image tag, Chart repository address, and version configuration file with the actual values of the corresponding version.
Usage Restrictions
Online installation is required, and the business cluster node must be able to access the following addresses:
- Online image registry:
cr.openfuyao.cn/openfuyao - Online Helm repository:
https://helm.openfuyao.cn/_core
Tutorial
1. Check the Target Environment
1.1 Confirm Management Plane Components Are Not Installed
Run on the business cluster node:
kubectl get ns openfuyao-system-controller openfuyao-system monitoring ingress-nginx
kubectl get deploy -A | grep -E "openfuyao|console|oauth|marketplace|monitoring"
kubectl get nodesIf namespaces such as openfuyao-system-controller, openfuyao-system, monitoring, ingress-nginx or management plane components already exist, please first confirm whether the current environment needs to be redeployed to avoid overwriting the existing management plane.
1.2 Confirm BKE/CAPI Control Plane Is Not Installed
kubectl get crd | grep -E "bke|cluster.x-k8s"
kubectl get pods -n cluster-systemIf there are no BKE/CAPI related CRDs in the environment, you cannot directly apply BKECluster type resources. This document uses the method of manually deploying openFuyao-system-controller to install the management plane.
1.3 Confirm the Deployment Template Exists
ls /etc/openFuyao/addons/manifests/kubernetes/openfuyao-system-controller/v26.9.0/openfuyao-system-controller.yaml
grep -n "{{" /etc/openFuyao/addons/manifests/kubernetes/openfuyao-system-controller/v26.9.0/openfuyao-system-controller.yamlThe template usually contains the following variables and cannot be applied directly:
{{ .repo }}
{{ .helmRepo }}
{{ .tagVersion }}2. Create patch-config
2.1 Confirm the Version Configuration File
Run on the business cluster node to confirm that the version configuration file used to create patch-config already exists:
ls /bke/mount/source_registry/files/patches/
grep -n "^openFuyaoVersion:" /bke/mount/source_registry/files/patches/VersionConfig-v26.09.yamlIf /bke/mount/source_registry/files/patches/VersionConfig-v26.09.yaml does not exist on the business cluster node, please first prepare the version configuration file at that path. This document uses the v26.09 version as an example. You can download it with the following command:
mkdir -p /bke/mount/source_registry/files/patches
curl -fLo /bke/mount/source_registry/files/patches/VersionConfig-v26.09.yaml \
https://openfuyao.obs.cn-north-4.myhuaweicloud.com/openFuyao/version-config/VersionConfig-v26.09.yamlIf openFuyaoVersion is v26.09, you can continue using this example; if it is another version, replace it with the corresponding version configuration file and synchronously replace the file name in subsequent commands.
2.2 Create namespace and ConfigMap
kubectl create ns openfuyao-system-controller --dry-run=client -o yaml | kubectl apply -f -
kubectl create cm patch-config \
-n openfuyao-system-controller \
--from-file=patch-data=/bke/mount/source_registry/files/patches/VersionConfig-v26.09.yaml \
--dry-run=client -o yaml | kubectl apply -f -
kubectl get cm patch-config -n openfuyao-system-controller3. Prepare openFuyao-system-controller YAML
3.1 Copy the Deployment Template
cp /etc/openFuyao/addons/manifests/kubernetes/openfuyao-system-controller/v26.9.0/openfuyao-system-controller.yaml /tmp/openfuyao-system-controller.yaml3.2 Render Online Parameters
sed -i 's#{{ if .repo }}{{ .repo }}{{ else }}cr.openfuyao.cn/openfuyao/{{ end }}openfuyao-system-controller:{{ .tagVersion }}#cr.openfuyao.cn/openfuyao/openfuyao-system-controller:26.9.0#g' /tmp/openfuyao-system-controller.yaml
sed -i 's#value: "{{ .repo }}"#value: "cr.openfuyao.cn/openfuyao"#g' /tmp/openfuyao-system-controller.yaml
sed -i 's#value: "{{ .helmRepo }}"#value: "https://helm.openfuyao.cn/_core"#g' /tmp/openfuyao-system-controller.yamlThe key configurations after rendering are as follows:
image: cr.openfuyao.cn/openfuyao/openfuyao-system-controller:26.9.0
OPENFUYAO_REGISTRY: cr.openfuyao.cn/openfuyao
HELM_REPORITORY_URL: https://helm.openfuyao.cn/_coreCheck whether the template variables have been cleaned up:
grep -n "{{" /tmp/openfuyao-system-controller.yamlIf there is no output, the template variables have been cleaned up.
Check the key fields:
grep -nE "image:|OPENFUYAO_REGISTRY|HELM_REPORITORY_URL|entrypoint.sh" /tmp/openfuyao-system-controller.yaml
grep -nA2 "OPENFUYAO_REGISTRY\|HELM_REPORITORY_URL" /tmp/openfuyao-system-controller.yaml4. Deploy openFuyao-system-controller
Run on the business cluster node:
kubectl apply -f /tmp/openfuyao-system-controller.yaml
kubectl get pods -n openfuyao-system-controller -wWhen the Pod is in Init:0/1, it means the installer initContainer is executing the installation process.
View the installation logs:
kubectl logs -n openfuyao-system-controller deploy/openfuyao-system-controller -c installer -fThe logs should show the online image registry and online Helm repository addresses:
cr.openfuyao.cn/openfuyao
https://helm.openfuyao.cn/_core5. Check the Installation Results
5.1 View All Components
kubectl get pods -A5.2 View Management Plane Components
kubectl get pods -n openfuyao-system
kubectl get pods -n ingress-nginx
kubectl get pods -n monitoringOn success, the core components should be Running or Completed, including:
console-serviceconsole-websitelocal-harbormarketplace-servicemonitoring-serviceoauth-serveroauth-webhookplugin-management-serviceuser-management-operatorweb-terminal-service
5.3 View Abnormal Pods
kubectl get pods -A | grep -Ev "Running|Completed"If there is no abnormal output, the openFuyao-system-controller and the management plane components it brought up have been deployed successfully.