# hyperf **Repository Path**: gusuling/hyperf ## Basic Information - **Project Name**: hyperf - **Description**: 使用K8s开发部署Hyperf, 服务注册与发现 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-02-02 - **Last Updated**: 2023-02-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Hyperf Develop > k8s单机部署 > 热更新 > 目录映射 > 方便开发微服务 ### minikube - https://github.com/kubernetes/minikube - https://minikube.sigs.k8s.io ```bash // 安装 curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 chmod +x minikub sudo mv minikube /usr/local/bin minikube start --registry-mirror=https://registry.docker-cn.com minikube stop minikube delete // 使用Minikube中的Docker守护进程 eval $(minikube docker-env) // 查看pods kubectl get po -A minikube kubectl -- get po -A // 面板 minikube dashboard // ingress minikube addons enable ingress ``` ### Hyperf ```bash // 进入虚拟机 minikube ssh // 克隆脚手架构建镜像 git clone https://gitee.com/armnerd/hyperf.git cd hyperf/build docker image build -t mine/hyperf . // 创建应用 kubectl apply -f build/hyperf.yaml ``` ### Ingress - Nginx Ingress Controller - https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/ - Copy && Paste && Apply ##### 部署 ```bash kubectl apply -f build/ingress.yaml ``` ##### Host:80 ```bash kubectl edit deployment nginx-ingress -n nginx-ingress hostNetwork: true ``` ##### 配置Hosts ```bash 127.0.0.1 local.hyperf.com ``` ### Satis > 私有Composer仓 ```bash composer create-project composer/satis php bin/satis build satis.json web/ ``` > satis.json ```bash { "name": "My Repository", "homepage": "http://packagist.pythonup.cn", "repositories": [ { "type": "vcs", "url": "https://gitee.com/armnerd/common-teacher.git" } ], "require": { "cuour/common-teacher": "*" }, "archive": { "directory": "dist", "format": "tar", "prefix-url": "http://packagist.pythonup.cn" } } ```