Month: June 2021

  • 从私有仓库拉取镜像

    从私有仓库拉取镜像

    参考文献: 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}" | base64 –decode 输出和下面类似: {"auths":{"registry.cn-hangzhou.aliyuncs.com":{"username":"****@aliyun.com","password":"****","email":"****@aliyun.com","auth":"****"}}} Store Secret to .dockerconfigjson file 在 kustomization.yaml 中使用它 apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: – backend/deployment.yaml secretGenerator: – name: regcred files:…

  • Nested JSON Validation in Laravel / Lumen

    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", "comment": "Objectively seize progressive ROI before unique bandwidth." }, { "media_ids": [4,5,6], "title": "Title B", "status": "B", "comment": "Objectively mesh sticky value for global data.…

  • 阿里云测试 MicroK8s 笔记

    阿里云测试 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 my remote server ip address ssh -fNT -L 16443:127.0.0.1:16443 microkube now: kubectl get node (base) ➜ .kube kubectl get nodes -o wide NAME STATUS ROLES…

  • 阿里云安装测试MiniKube

    阿里云安装测试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, because minikube can not start from root user. # create a user called docker, add to group docker useradd docker docker modify docker as sudo…

  • Github: 测试,构建和发布容器镜像到阿里云容器镜像服务