Online Scenario openFuyao-system-controller Manual Deployment Guide
Background Information
This document describes how to, in an online scenario, manually prepare patch-config, render, and deploy openFuyao-system-controller in a Kubernetes environment where openFuyao-system-controller has not been automatically deployed by BKE, thereby launching 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 registry.
Prerequisites
The following machines have been prepared:
| Role | Example IP | Purpose |
|---|---|---|
| Business Node | 192.168.200.216 | Existing Kubernetes cluster, manually deploy openFuyao-system-controller and launch management plane |
Machine hardware configuration can 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 | Later copied from the local template directory and rendered in Section 3 |
VersionConfig-latest.yaml | Component version configuration used for latest version installation | This document reads from /bke/mount/source_registry/files/patches/VersionConfig-latest.yaml as an example |
Note:
This document uses thelatestversion as an example. You can confirm the current version through the version configuration file: if you are usingVersionConfig-latest.yamland theopenFuyaoVersionfield in the file islatest, it is thelatestversion; if you are using a specified version configuration file such asCore-VersionConfig-v26.06-rc.1.yaml, it is the corresponding version. For non-latestversions, please replace the image tags, Chart registry addresses, and version configuration files with the actual values of the corresponding version.
Usage Limitations
Online installation is required. The business node must be able to access the following addresses:
- Online image registry:
cr.openfuyao.cn/openfuyao - Online Helm registry:
https://helm.openfuyao.cn/_core
Usage Tutorial
1. Verify the Target Environment
1.1 Confirm Management Plane Components Are Not Installed
Execute on the business 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 or management plane components such as openfuyao-system-controller, openfuyao-system, monitoring, ingress-nginx 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 manual deployment method of openfuyao-system-controller to install the management plane.
1.3 Confirm the Deployment Template Exists
ls /etc/openFuyao/addons/manifests/kubernetes/openfuyao-system-controller/latest/openfuyao-system-controller.yaml
grep -n "{{" /etc/openFuyao/addons/manifests/kubernetes/openfuyao-system-controller/latest/openfuyao-system-controller.yamlThe template usually contains the following variables and cannot be directly applied:
{{ .repo }}
{{ .helmRepo }}
{{ .tagVersion }}2. Create patch-config
2.1 Confirm the Version Configuration File
Execute on the business node to confirm that the version configuration file for creating patch-config exists:
ls /bke/mount/source_registry/files/patches/
grep -n "^openFuyaoVersion:" /bke/mount/source_registry/files/patches/VersionConfig-latest.yamlIf the business node does not have /bke/mount/source_registry/files/patches/VersionConfig-latest.yaml, please first prepare the version configuration file at that path. This document uses the latest 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-latest.yaml \
https://openfuyao.obs.cn-north-4.myhuaweicloud.com/openFuyao/version-config/VersionConfig-latest.yamlIf openFuyaoVersion is latest, you can continue using the examples in this document; if it is another version, please replace it with the corresponding version configuration file and synchronize the file names 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-latest.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/latest/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:latest#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 configuration after rendering is as follows:
image: cr.openfuyao.cn/openfuyao/openfuyao-system-controller:latest
OPENFUYAO_REGISTRY: cr.openfuyao.cn/openfuyao
HELM_REPORITORY_URL: https://helm.openfuyao.cn/_coreVerify that template variables have been cleared:
grep -n "{{" /tmp/openfuyao-system-controller.yamlIf there is no output, it indicates that the template variables have been cleared.
Verify 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
Execute on the business node:
kubectl apply -f /tmp/openfuyao-system-controller.yaml
kubectl get pods -n openfuyao-system-controller -wWhen the Pod is in Init:0/1 state, it indicates that the installer initContainer is executing the installation process.
View 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 registry addresses:
cr.openfuyao.cn/openfuyao
https://helm.openfuyao.cn/_core5. Verify 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 monitoringWhen successful, 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, it indicates that openFuyao-system-controller and the management plane components it launched have been deployed successfully.