脱坑: Amazon EFS CSI 驱动程序

首先,通过 Provision an EKS Cluster (AWS) 这篇文章,可以快捷的利用 terraform 在AWS 上部署一套 EKS。 如果想使用 pvc 和 pv,我们还需要给 K8s 安装 CSI 驱动。 AWS 给了我们一偏很详尽的安装说明: https://docs.amazonaws.cn/eks/latest/userguide/efs-csi.html 但是,我真心不知道有多少朋友能一次性就安装成功的。 为了方便管理和部署,我把 efs csi 安装过程 翻译成了 terraform 语义, …

HLD 和 LLD 的区别

High Level Design  (HLD) 概要设计说明是指系统的总体设计。它是对应用程序的总体描述。包括系统架构设计、数据库设计、系统、服务、平台及模块间关系的简要描述。它也被称为宏级/系统设计。它是由解决方案架构师创建的。它将业务/客户端需求转换为高级解决方案。它是在详细设计说明(LLD)之前建立的。 Low Level Design (LLD) 简单地说,详细设计说明就像详细的HLD意味着它指的是组件级设计过程。它对每个模块进行了详细的描述,意味着它包含了每个系统组件的实际逻辑,并深入到每个模块的规范中。这也被称为微观层次/详细设计。它是由设计师和开发人员创建的。它将概要解决方案转换为详细解决方案。它是概要设计说明之后创建。 HLD LLD HLD是指系统的总体设计。 LLD就像细化HLD意味着它指的是组件级设计过程。 High Level Design in short called as HLD. Low Level Design in short called as LLD. …

从私有仓库拉取镜像

参考文献: https://kubernetes.io/zh/docs/tasks/configure-pod-container/pull-image-private-registry/ 在集群中创建保存授权令牌的 Secret Create Secret kubectl create secret docker-registry yyy-regcred \ –docker-server=registry.cn-hangzhou.aliyuncs.com \ –docker-username=****@aliyun.com \ –docker-password=**** \ –docker-email=****@aliyun.com ## output -> secret/yyy-regcred created 获取凭证 kubectl get secret yyy-regcred –output="jsonpath={.data.\.dockerconfigjson}" …

Nested JSON Validation in Laravel / Lumen

我们可能会提交这样一个请求,一个 嵌套的 JSON 对象,那么如何对 JSON 对象的那边元素进行验证呢? ### Save Post Comments POST {{API_BASE_URL}}/module/v1/posts/2/comments Content-Type: application/json Accept: application/json Authorization: Bearer {{TOKEN}} { "data": [ { "media_ids": [1,2,3], "title": "Title A", "status": "A", …

阿里云测试 MicroK8s 笔记

资料收集: https://stackoverflow.com/questions/63974879/microk8s-metallb-ingress-nginx-how-to-route-external-traffic https://pacroy.medium.com/single-node-kubernetes-on-home-lab-using-microk8s-metallb-and-traefik-7bb1ea38fcc2 SSL: https://stackoverflow.com/questions/67430592/how-to-setup-letsencrypt-with-kubernetes-microk8s-using-default-ingress 验证: 2021-06-24 kubectl remote control get config microk8s kubectl config view –raw > $HOME/.kube/config save the config file to local $HOME/.kube/config 设置端口转发 ## minikube is …

阿里云安装测试MiniKube

minikube 不适用于生产环境,只适合玩玩,研究太多没有多大意义,建议转向 MicroK8s set kubectl connect to remote minikube from local 1. before install minikube, you need install docker first. Install Docker Engine on Ubuntu 2. create a new user, …

A simple API Gateway in Lumen

如何使用 Lumen 开发一个简单的 API Gateway Routes create a file called gateway.php in config folder. Register gateway to lumen routes. Edit AppServiceProvider.php in app/Providers/ folder. Controller AppServiceProvider will send all request …

PHP 冒泡算法

没什么用,写了玩玩的。 function bubble_sort(array $items): array { for ($i = 0; $i < count($items); $i++) { for ($j = $i + 1; $j < count($items); $j++) { if ($items[$i] > $items[$j]) …

Laravel/Lumen Customizing Monolog For Channels

官方文档 https://laravel.com/docs/6.x/logging#creating-monolog-handler-channels 首先 新建一个 文件: 如官方文档所示,可以在 __invoke 方法里定制你的 logger,例如你想要 json 格式的日志的话: 更多设置: 输出的日志样本如下: { “message”: “Undefind method: \”asdasdad\””, “context”: {}, “level”: 400, “level_name”: “ERROR”, “channel”: “local”, “datetime”: “2020-05-11T17:05:07.231673+08:00”, “extra”: { …

Multiple middleware parameters in Lumen

Add route middleware in bootstrap/app.php To middleware to routes within a group, Use “,” separate roles, don’t use “|” as separater, the tutorial from here https://docs.spatie.be/laravel-permission/v3/basic-usage/middleware/ is for Laravel only …

HTTP Public Key Pinning 公钥固定介绍

文件名 内容 chain.pem 浏览器需要的所有证书但不包括服务端证书,比如根证书和中间证书 fullchain.pem 包括了cert.pem和chain.pem的内容 privkey.pem 证书的私钥 cert1.pem或cert.pem 服务端证书 添加以下行并插入适当的 pin-sha256 =“…”的值将在您的nginx上启用HPKP

递归 (JavaScript && PHP)

编程语言中,函数Func(Type a,……)直接或间接调用函数本身,则该函数称为递归函数。递归函数不能定义为内联函数。

Nginx fastcgi_cache And proxy_cache

FastCGI Cache Example FastCGI Cache VS WP Super Cache FastCGI cache is faster than WP Super Cache because the latter uses .htaccess and PHP itself to route the visitor to …

PHP 模拟 RSA 算法

从 1-10 中间任意取两个 质素 p 和 q 让 p*q = n funN = (p-1) * (q-1) 获取 公钥 e: – 1 < e < funN– e 和 funN 互质 获取 …