-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
26 lines (26 loc) · 16.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!doctype html><html lang=zh dir=auto><head><meta name=generator content="Hugo 0.140.2"><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><title>Pota Blog</title>
<meta name=keywords content="Blog,wrpota"><meta name=description content="wrpota Personal blog"><meta name=author content="wrpota"><link rel=canonical href=https://www.potawang.cn/><link crossorigin=anonymous href=/assets/css/stylesheet.d6fcd20a4fb86efa4dfac8ec95da60244cc8871042183da1ef28e3a762ad79c8.css integrity="sha256-1vzSCk+4bvpN+sjsldpgJEzIhxBCGD2h7yjjp2Ktecg=" rel="preload stylesheet" as=style><link rel=icon href=https://www.potawang.cn/%3Clink%20/%20abs%20url%3E><link rel=icon type=image/png sizes=16x16 href=https://www.potawang.cn/%3Clink%20/%20abs%20url%3E><link rel=icon type=image/png sizes=32x32 href=https://www.potawang.cn/%3Clink%20/%20abs%20url%3E><link rel=apple-touch-icon href=https://www.potawang.cn/%3Clink%20/%20abs%20url%3E><link rel=mask-icon href=https://www.potawang.cn/%3Clink%20/%20abs%20url%3E><meta name=theme-color content="#2e2e33"><meta name=msapplication-TileColor content="#2e2e33"><link rel=alternate type=application/rss+xml href=https://www.potawang.cn/index.xml><link rel=alternate type=application/json href=https://www.potawang.cn/index.json><link rel=alternate hreflang=zh href=https://www.potawang.cn/><noscript><style>#theme-toggle,.top-link{display:none}</style><style>@media(prefers-color-scheme:dark){:root{--theme:rgb(29, 30, 32);--entry:rgb(46, 46, 51);--primary:rgb(218, 218, 219);--secondary:rgb(155, 156, 157);--tertiary:rgb(65, 66, 68);--content:rgb(196, 196, 197);--code-block-bg:rgb(46, 46, 51);--code-bg:rgb(55, 56, 62);--border:rgb(51, 51, 51)}.list{background:var(--theme)}.list:not(.dark)::-webkit-scrollbar-track{background:0 0}.list:not(.dark)::-webkit-scrollbar-thumb{border-color:var(--theme)}}</style></noscript><meta name=baidu-site-verification content="code-0ekyOXOMm0"><script>var _hmt=_hmt||[];(function(){var e,t=document.createElement("script");t.src="https://hm.baidu.com/hm.js?dcdb96e6d8ef04e6ae19d0a74a1063c6",e=document.getElementsByTagName("script")[0],e.parentNode.insertBefore(t,e)})()</script><script defer data-domain=potawang.cn src=https://ana.yzhyai.com/js/script.js></script><meta property="og:url" content="https://www.potawang.cn/"><meta property="og:site_name" content="Pota Blog"><meta property="og:title" content="Pota Blog"><meta property="og:description" content="wrpota Personal blog"><meta property="og:locale" content="zh"><meta property="og:type" content="website"><meta property="og:image" content="https://www.potawang.cn/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://www.potawang.cn/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta name=twitter:title content="Pota Blog"><meta name=twitter:description content="wrpota Personal blog"><script type=application/ld+json>{"@context":"https://schema.org","@type":"Organization","name":"Pota Blog","url":"https://www.potawang.cn/","description":"wrpota Personal blog","logo":"https://www.potawang.cn/%3Clink%20/%20abs%20url%3E","sameAs":[]}</script></head><body class=list id=top><script>localStorage.getItem("pref-theme")==="dark"?document.body.classList.add("dark"):localStorage.getItem("pref-theme")==="light"?document.body.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches&&document.body.classList.add("dark")</script><header class=header><nav class=nav><div class=logo><a href=https://www.potawang.cn/ accesskey=h title="Wrpota (Alt + H)">Wrpota</a><div class=logo-switches><button id=theme-toggle accesskey=t title="(Alt + T)"><svg id="moon" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg><svg id="sun" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></button></div></div><ul id=menu><li><a href=https://www.potawang.cn/categories title=Categories><span>Categories</span></a></li><li><a href=https://www.potawang.cn/tags title=Tags><span>Tags</span></a></li><li><a href=https://www.potawang.cn/search title="Search (Alt + /)" accesskey=/><span>Search</span></a></li><li><a href=https://www.potawang.cn/archives title=Archives><span>Archives</span></a></li><li><a href=https://www.potawang.cn/about title=About><span>About</span></a></li></ul></nav></header><main class=main><article class=first-entry><header class=entry-header><h2 class=entry-hint-parent>使用Certbot申请域名证书</h2></header><div class=entry-content><p>服务器安装 certbot CentOS # 将EPEL扩展库添加到CentOS 7 $ yum install epel-release # 安装snapd $ yum install snapd # 启用snapd.socket $ systemctl enable --now snapd.socket # 创建软链接,用来启用classic snap支持 $ ln -s /var/lib/snapd/snap /snap # 确保snapd版本是最新的 $ snap install core $ snap refresh core # 移除yum上的certbot,进一步确保certbot是通过snap安装的 $ yum remove certbot $ snap install --classic certbot $ ln -s /snap/bin/certbot /usr/bin/certbot Debian $ apt update $ apt install snapd $ snap install core $ snap refresh core $ snap install --classic certbot $ ln -s /snap/bin/certbot /usr/bin/certbot 通过DNS TXT验证申请证书 输入命令 certbot --manual --preferred-challenges dns certonly 进行验证申请证书
...</p></div><footer class=entry-footer><span title='2024-05-13 17:40:30 +0800 +0800'>五月 13, 2024</span> · 3 分钟 · wrpota</footer><a class=entry-link aria-label="post link to 使用Certbot申请域名证书" href=https://www.potawang.cn/post/certbot_apply_ssl/></a></article><article class=post-entry><header class=entry-header><h2 class=entry-hint-parent>同步gitea仓库到github</h2></header><div class=entry-content><p>为了确保仓库速度和防止github账号出现问题,在个人服务器搭建了gitea并配置了Drone CI,具体搭建方法网上很多这里就不在说明了。
远程仓库 这里指的是Github,创建专门用来同步的SSH-KEY,当然直接使用你一直在用的也行,但是为了防止数据泄露,最好创建一个单独使用的。 在Drone里开启需要同步仓库的CI并在 Setting > Secrets 中将密钥添加进去,Key自定义即可,这里使用的是SSH-KEY Gitea仓库添加.drone.yml文件 并填入以下内容 kind: pipeline type: docker name: build steps: - name: sync-to-github image: appleboy/drone-git-push settings: branch: master remote: [email protected]:example/example.git #远程仓库地址 remote_name: master #需要推送到哪个分支 force: true #是否强制推送 commit: true ssh_key: #使用上面设置的key进行推送 from_secret: SSH-KEY trigger: branch: - master 如果一切正常应该能看到以下构建过程 至此,当前仓库就会自动同步备份到GitHub中</p></div><footer class=entry-footer><span title='2022-09-01 15:52:11 +0800 +0800'>九月 1, 2022</span> · 1 分钟 · wrpota</footer><a class=entry-link aria-label="post link to 同步gitea仓库到github" href=https://www.potawang.cn/post/gitea_sync_to_github/></a></article><article class=post-entry><header class=entry-header><h2 class=entry-hint-parent>K3s 安装</h2></header><div class=entry-content><p>安装 主节点 curl -sfL http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn INSTALL_K3S_EXEC="--no-deploy traefik" sh - curl -sfL http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn INSTALL_K3S_EXEC="--tls-san 121.5.251.228 --node-ip 121.5.251.228 --node-external-ip 121.5.251.228 --no-deploy servicelb --flannel-backend wireguard --kube-proxy-arg "proxy-mode=ipvs" "masquerade-all=true" --kube-proxy-arg "metrics-bind-address=0.0.0.0" --no-deploy traefik " sh - 安装后 /var/lib/rancher/k3s/server/node-token 获取K3S_TOKEN
删除自带的traefik 如果安装后不需要使用自带的traefik可使用以下方法删除 kubectl -n kube-system get pods
删除traefik资源: kubectl -n kube-system delete helmcharts.helm.cattle.io traefik 停止k3s服务: sudo service k3s stop 编辑服务文件sudo vim /etc/systemd/system/k3s.service并将此行添加到ExecStart : –no-deploy traefik \ 重新加载服务文件: sudo systemctl daemon-reload 从自动部署文件夹中删除清单文件: sudo rm /var/lib/rancher/k3s/server/manifests/traefik.yaml 启动k3s服务: sudo service k3s start 添加子节点 K3S_TOKEN=`cat /var/lib/rancher/k3s/server/node-token` curl -sfL http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn K3S_URL=https://domain:6443 K3S_TOKEN=${K3S_TOKEN} sh - curl -sfL http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn K3S_URL=https://121.5.251.228:6443 K3S_TOKEN=K10051304dff023c4c7ee9bece98d2cd97874f6bbae7162c6b44f559f63f9f9c6ad::server:3583bfbd2e01f12f2a4971cf38b5bbea sh - 代理 Dashboard kubectl port-forward $(kubectl get pods --selector "app.kubernetes.io/name=traefik" --output=name) 9000:9000 --address=0.0.0.0 centos 8 安装 wireguard sudo curl -Lo /etc/yum.repos.d/wireguard.repo https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo sudo yum install epel-release -y sudo yum install wireguard-dkms wireguard-tools -y kubeconfig 默认地址 etc/rancher/k3s/k3s.yaml
...</p></div><footer class=entry-footer><span title='2021-08-23 15:28:33 +0800 +0800'>八月 23, 2021</span> · 1 分钟 · wrpota</footer><a class=entry-link aria-label="post link to K3s 安装" href=https://www.potawang.cn/post/k3s/></a></article><article class=post-entry><header class=entry-header><h2 class=entry-hint-parent>使用GitHub Action自动发布Hugo博客</h2></header><div class=entry-content><p>使用GitHub Pages配合Hugo搭建Blog中,往往出于各种原因需要将编译前的文件隐藏,如果使用一个仓库进行管理无法实现,而GitHub Pages无法使用私有仓库发布,一开始使用一个私有仓库进行原始文件版本管理,每次编辑后需要将pubilc目录单独再提交至对应的GitHub Pages仓库,此时的步骤应该是:
编写文章 提交至private repo进行版本管理 本地生成静态文件 将静态文件Push至github pages repo 一个文章的改动非常的不方便,经过后续搜索发现可以使用GitHub提供的action配合hugo官方提供的action自动进行后两步,修改后发布文章只需要再编写后提交至private repo即可,方便再任意终端上随时记录内容
GitHub 仓库配置 在GitHub头像下拉框选择Setting > Developer Settings > Personal access tokens 选择Generate new token 在上方填入名字,并按勾选 repo 和 admin:repo_hook 下的所有选项 点击 Generate token 生成token,并复制保存好该token 在private repo 中选择 Setting > secrets > New repository secret NAME填入ACTION_PERSONAL_ACCESS_TOKEN内容填入上面获取的token Private Repo 配置 在private repo根目录新建嵌套的两个文件夹.github/workflows
在workflows里新建一个后缀为.yml的配置文件,名字自取。 写进去以下配置内容:
name: github pages # 名字自取 on: push: branches: - main #当main分支触发push事件时执行当前任务 jobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: submodules: true fetch-depth: 0 - name: Hugo uses: peaceiris/actions-hugo@v2 # hugo官方提供的action with: hugo-version: 'latest' #hugo 版本 - name: Build run: hugo --minify #构建静态网页 - name: Deploy uses: peaceiris/actions-gh-pages@v3 # 自动发布的action with: external_repository: wrpota/wrpota.github.io personal_token: ${{ secrets.ACTION_PERSONAL_ACCESS_TOKEN }} publish_dir: ./public publish_branch: main 此时将原来的hugo目录提交至私有库中即可触发自动构建发布动作。 ...</p></div><footer class=entry-footer><span title='2021-07-16 17:19:05 +0800 +0800'>七月 16, 2021</span> · 1 分钟 · wrpota</footer><a class=entry-link aria-label="post link to 使用GitHub Action自动发布Hugo博客" href=https://www.potawang.cn/post/hugo_release_by_github/></a></article><article class=post-entry><header class=entry-header><h2 class=entry-hint-parent>Macos 安装k8s</h2></header><div class=entry-content><p>开启 Macos Docker Desktop 中的 K8s 支持 tips: 此操作需要科学上网支持
等待docker执行完成后 对应容器就启动好了
安装 Kubernetes Dashboard Web UI kubectl proxy kubectl proxy在您的机器和 Kubernetes API 服务器之间创建一个代理服务器。默认情况下,它只能在本地访问(从启动它的机器)。 先检查是否kubectl配置正确并且可以访问集群,若出现错误请自行排查
kubectl cluster-info 输出:
Kubernetes control plane is running at https://kubernetes.docker.internal:6443 CoreDNS is running at https://kubernetes.docker.internal:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. 启动本地代理服务器
kubectl proxy 若输出以下内存则进行下一步:
Starting to serve on 127.0.0.1:8001 访问:
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login 如下所示 通过下方命令获取Token 登录
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}') ...</p></div><footer class=entry-footer><span title='2021-07-14 15:12:44 +0800 +0800'>七月 14, 2021</span> · 1 分钟 · wrpota</footer><a class=entry-link aria-label="post link to Macos 安装k8s" href=https://www.potawang.cn/post/macos_k8s/></a></article><footer class=page-footer><nav class=pagination><a class=next href=https://www.potawang.cn/page/2/>下一页 »</a></nav></footer></main><footer class=footer><span>© 2025 <a href=https://www.potawang.cn/>Pota Blog</a></span>
<span>Powered by
<a href=https://gohugo.io/ rel="noopener noreferrer" target=_blank>Hugo</a> &
<a href=https://git.io/hugopapermod rel=noopener target=_blank>PaperMod</a>
</span><span><a href=https://beian.miit.gov.cn/#/Integrated/index target=_blank>苏ICP备18012635号</a></span></footer><a href=#top aria-label="go to top" title="Go to Top (Alt + G)"><button class=top-link id=top-link type=button accesskey=g>
<svg viewBox="0 0 12 6" fill="currentcolor"><path d="M12 6H0l6-6z"/></svg>
</button>
</a><script>let menu=document.getElementById("menu");menu.scrollLeft=localStorage.getItem("menu-scroll-position"),menu.onscroll=function(){localStorage.setItem("menu-scroll-position",menu.scrollLeft)},document.querySelectorAll('a[href^="#"]').forEach(e=>{e.addEventListener("click",function(e){e.preventDefault();var t=this.getAttribute("href").substr(1);window.matchMedia("(prefers-reduced-motion: reduce)").matches?document.querySelector(`[id='${decodeURIComponent(t)}']`).scrollIntoView():document.querySelector(`[id='${decodeURIComponent(t)}']`).scrollIntoView({behavior:"smooth"}),t==="top"?history.replaceState(null,null," "):history.pushState(null,null,`#${t}`)})})</script><script>var mybutton=document.getElementById("top-link");window.onscroll=function(){document.body.scrollTop>800||document.documentElement.scrollTop>800?(mybutton.style.visibility="visible",mybutton.style.opacity="1"):(mybutton.style.visibility="hidden",mybutton.style.opacity="0")}</script><script>document.getElementById("theme-toggle").addEventListener("click",()=>{document.body.className.includes("dark")?(document.body.classList.remove("dark"),localStorage.setItem("pref-theme","light")):(document.body.classList.add("dark"),localStorage.setItem("pref-theme","dark"))})</script></body></html>