<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Patrickuuuu on Medium]]></title>
        <description><![CDATA[Stories by Patrickuuuu on Medium]]></description>
        <link>https://medium.com/@hank93513?source=rss-34fc0f7adefd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*F9OyNQKNjABxuEfy</url>
            <title>Stories by Patrickuuuu on Medium</title>
            <link>https://medium.com/@hank93513?source=rss-34fc0f7adefd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 21:01:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hank93513/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[在 Firewalld 上設定 Kubernetes 的防火牆規則]]></title>
            <link>https://medium.com/@hank93513/%E5%9C%A8-firewalld-%E4%B8%8A%E8%A8%AD%E5%AE%9A-kubernetes-%E7%9A%84%E9%98%B2%E7%81%AB%E7%89%86%E8%A6%8F%E5%89%87-8691d97f909d?source=rss-34fc0f7adefd------2</link>
            <guid isPermaLink="false">https://medium.com/p/8691d97f909d</guid>
            <category><![CDATA[on-premise]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[firewall]]></category>
            <category><![CDATA[firewalld]]></category>
            <dc:creator><![CDATA[Patrickuuuu]]></dc:creator>
            <pubDate>Tue, 21 May 2024 14:18:58 GMT</pubDate>
            <atom:updated>2024-05-21T14:18:58.693Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>使用 firewalld 可以讓我們更快的對於防火牆進行設定，而不需要對於 iptable 進行操作</blockquote><p>防火牆是保護 Kubernetes 集群安全的其中一個關鍵。正確設置防火牆規則不僅可以防止一些來路不明的訪問，提升集群的安全性，還能有效控制網絡流量，來確保集群的正常運行和穩定性。不過，如果沒有設定完善，也可能導致集群無法正常運作。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*7bCOrmoTcb0cIm2eZVrQSg.png" /></figure><p><strong>安裝 firewalld</strong></p><ul><li>firewalld 啟動後會<strong>預設開啟 22 port</strong>，如果是遠端操作請放心服用。</li></ul><ol><li>首先，我們要將 <em>firewalld </em>安裝至伺服器上</li></ol><pre># Install Firewalld on Debian / Ubuntu<br>sudo apt update &amp;&amp; sudo apt -y install firewalld</pre><p>2. 再來，在系統服務中啟用 <em>firewalld</em>，並檢查有沒有正常啟動。</p><pre>sudo systemctl enable firewalld &amp;&amp; sudo firewall-cmd --state<br>#(應該要出現) running</pre><p>3. 關閉預設防火牆 <em>UFW</em></p><pre>sudo ufw disable</pre><p>這樣就完成 <em>firewall </em>的安裝了，接下來就可以進行規則的設定。</p><p><strong>設定 Control Plane(s)</strong></p><p>Control Plane 會使用到的相關 Ports<br>Protocal Port, Port Range, Purpose, Used By</p><ul><li>TCP 6443, <strong><em>Kubernetes API server</em></strong>, All</li><li>TCP 2379–2380, <strong><em>etcd server client API</em></strong>,<strong><em> kube-apiserver &amp; etcd</em></strong></li><li>TCP 10250, <strong><em>Kubelet API</em></strong>,<strong><em> Control plane</em></strong></li><li>TCP 10259, <strong><em>kube-scheduler</em></strong>, <strong><em>Self</em></strong></li><li>TCP 10257, <strong><em>kube-controller-manager</em></strong>, <strong><em>Self</em></strong></li></ul><pre># 以下兩個一定要加<br>sudo firewall-cmd --add-port=6443/tcp --permanent<br>sudo firewall-cmd --add-port=10250/tcp --permanent<br><br># 根據集群的部署方式來決定<br>sudo firewall-cmd --add-port=2379-2380/tcp --permanent<br><br># 通常不需要<br>sudo firewall-cmd --add-port=10257/tcp --permanent<br>sudo firewall-cmd --add-port=10259/tcp --permanent</pre><p><strong>設定 (Workder) Node(s)</strong></p><p>Worker Nodes 會使用到的相關 Ports<br>Protocal Port, Port Range, Purpose, Used By</p><ul><li>TCP 10250, <strong><em>Kubelet API</em></strong>, <strong><em>Control plane</em></strong></li><li>TCP 10256, <strong><em>kube-proxy</em>,<em> Self &amp; Load Balancer</em></strong></li><li>TCP 30000–32767, <strong><em>NodePort Services</em></strong>, <strong><em>All</em></strong></li></ul><pre># 以下兩個一定要加<br>sudo firewall-cmd --add-port=10250/tcp --permanent<br><br># 根據集群的部署方式來決定<br>sudo firewall-cmd --add-port=10256/tcp --permanent<br><br># 如果希望以 NodePort 方式部署的服務能被訪問就要加<br>sudo firewall-cmd --add-port=30000-32767/tcp --permanent</pre><p><strong>應用新增的規則</strong></p><pre>sudo firewall-cmd --reload<br>#(應該要出現) success</pre><p>檢查目前所有的規則</p><pre>sudo firewall-cmd --zone=public --list-ports<br>#(Control plane 至少要出現) <br>6443/tcp 10250/tcp<br>#(Worker Node 至少要出現) <br>10250/tcp</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8691d97f909d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[在 Kubernetes 上部屬自己的 Sentry]]></title>
            <link>https://medium.com/@hank93513/deploy-your-own-sentry-in-kubernetes-fc255e0e31e6?source=rss-34fc0f7adefd------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc255e0e31e6</guid>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[sentry]]></category>
            <dc:creator><![CDATA[Patrickuuuu]]></dc:creator>
            <pubDate>Tue, 26 Sep 2023 03:53:12 GMT</pubDate>
            <atom:updated>2023-09-26T04:01:06.510Z</atom:updated>
            <content:encoded><![CDATA[<h4>Use Helm to deploy Sentry on AWS EKS</h4><blockquote>Take action on broken lines of code, crashes, and busted API calls with the only<br>developer-first app monitoring platform built to give you answers — not clues.<br> — Sentry</blockquote><h4>使用環境</h4><ul><li>Windows 11 專業版</li><li>AWS EKS v1.27、Kubectl v1.27</li><li>Helm v3.12.2</li><li>Sentry Chart v20.5.3、Sentry v23.8.0</li></ul><h4>安裝 必要套件</h4><p><strong>1. Kubectl</strong> — 與 Kubernetes 溝通的橋樑</p><blockquote>The Kubernetes command-line tool, <a href="https://kubernetes.io/docs/reference/kubectl/kubectl/">kubectl</a>, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.</blockquote><p><a href="https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/">Install and Set Up kubectl on Windows</a></p><p><strong>2. Helm</strong> — 快速部屬程式至Kubernetes</p><blockquote>Helm is the best way to find, share, and use software built for <a href="https://kubernetes.io/">Kubernetes</a>.</blockquote><p><a href="https://helm.sh/docs/intro/install/">Installing Helm | Helm</a></p><h4>安裝 EKS 上的套件</h4><ul><li><a href="https://docs.aws.amazon.com/zh_tw/eks/latest/userguide/aws-load-balancer-controller.html">安裝 AWS Load Balancer Controller 附加元件</a></li><li><a href="https://docs.aws.amazon.com/zh_tw/eks/latest/userguide/ebs-csi.html">Amazon EBS CSI 驅動程式</a></li></ul><h4>安裝 Sentry</h4><p>1. 新增 Sentry Chart (Repo) 至 Helm</p><pre>helm repo add sentry https://sentry-kubernetes.github.io/charts</pre><p>2. 建立 NameSpace</p><pre>kubectl create ns sentry</pre><p>2. 下載設定檔 — <a href="https://github.com/sentry-kubernetes/charts/blob/develop/sentry/values.yaml">values.yaml</a></p><blockquote>範例程式的 namespace 設定為 sentry，可依照自己的狀況進行調整!</blockquote><p>要安裝 sentry 前，需要先將我們所需的設定設定好，最後的結果才會使我們所想要的。而在設定前，我們需要先下載<a href="https://github.com/sentry-kubernetes/charts/blob/develop/sentry/values.yaml"><strong>預設的設定</strong></a><strong>檔</strong>。</p><pre>wget https://github.com/sentry-kubernetes/charts/blob/develop/sentry/values.yaml -o values.yaml</pre><p>接下來，就可以調整裡面的數值了</p><p><strong><em>a. user</em></strong></p><p>是我們要登入到 web 的使用者，也是最開始的super user。<br>其中password可以以secret的方式儲存，並將secret以及secret-key設定到value.yaml上。</p><pre>kubectl create secret generic sentry-admin-password --from-literal=admin-password=&lt;this_is_password&gt; -n sentry</pre><pre>user:<br>  create: true<br>  email: admin@test.com<br>  # password: <br>  existingSecret: sentry-admin-password<br>  existingSecretKey: admin-password</pre><p><strong><em>b. asHook</em></strong></p><p>如果你是在 update 整個 app，記得改為 false。<br>不過我們現在是首次安裝，所以記得設定為 true。</p><pre>asHook: true</pre><p><strong><em>c. sentry-web</em></strong></p><p>網站設定，根據Sentry在<a href="https://github.com/sentry-kubernetes/charts/tree/develop/sentry#symbolicator-and-or-javascript-source-maps">Github中提到</a>的</p><blockquote>Note: If you need to run or cannot avoid running sentry-worker and sentry-web on different cluster nodes, you need to set filestore.filesystem.persistence.accessMode: ReadWriteMany or might get problems. HOWEVER, not all volume drivers support it, like AWS EBS or GCP disks. So you would want to create and use a StorageClass with a supported volume driver like AWS EFS</blockquote><p>因為AWS EKS的CSI預設的Storage Class為 AWS EBS，而如上所述 EBS 不支援 ReadWriteMany 的模式，因此，我們可以列出以下幾種解決辦法</p><ul><li>將 Storage Class 改為支援 RWO 的 <a href="https://docs.aws.amazon.com/zh_tw/eks/latest/userguide/efs-csi.html">AWS EFS</a></li><li>將 Storage Class 改為支援 RWO 的 NFS</li><li>使用 S3 / GCS 為 Filestore</li><li>將 sentry-worker 及 sentry-web 運行在同一個 node 上</li></ul><p>很明顯，最輕易的解法就是使用 nodeSelector 指定使得 worker 及 web 的 pods 運行在同一個 Node 上。而 nodeSelector 是使用 label 來選擇 pods 所運行的 node。</p><pre># nodeSelector 可以指定該 Pods 運行在哪個 node 上<br>sentry:  <br>  web:<br>    ...<br>    nodeSelector: {<br>      sentry-label: worker<br>                }<br>  ...<br>  worker:<br>    ...<br>    nodeSelector: {<br>      sentry-label: worker<br>                }</pre><ul><li>sentry-label 為 node 擁有的 label</li><li>worker 為該 label 的值</li><li>如果 label 有包含斜線，selector也必須包含斜線，例如</li></ul><pre>nodeSelector{<br>  kubernetes.io/hostname=ip-&lt;ip&gt;.&lt;region&gt;.compute.internal<br>}</pre><ul><li>其他詳情請見官方文件 <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/">Labels and Selectors</a></li></ul><p>如果不知道node含有哪些label，以下指令可以查看Cluster內所有的nodes以及它擁有的labels</p><pre>kubectl get nodes --show-labels</pre><p>或是執行以下指令</p><pre>kubectl describe nodes</pre><p>其中 每個 node 底下的的 Labels，就是該 node 所擁有的 label 。</p><p>如果要<a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/#add-a-label-to-a-node">新增 label</a> (以key為sentry-label value為worker作範例)</p><pre>kubectl label nodes &lt;your-node-name&gt; sentry-label=worker</pre><p>因為我們沒有改變 Access mode，同為 RWO，因此還需要將 strategyType 改為 Recreate。</p><pre>sentry:<br>  web:<br>    strategyType: Recreate<br>    ...<br>    </pre><p><strong><em>d. sentry-worker</em></strong></p><p>同上，我們需要將 sentry-worker 指定到跟 sentry-web 同一個 node 上</p><pre># 注意 web 及 worker 的 nodeSelector 一定要確保在同個 node 上<br>sentry:  <br>  web:<br>    ...<br>    nodeSelector: {<br>      sentry-label: worker<br>                }<br>  ...<br>  worker:<br>    ...<br>    nodeSelector: {<br>      sentry-label: worker<br>                }</pre><p><strong><em>e. hooks</em></strong></p><p>將 activeDeadlineSeconds 設定為 1000 以免 pods 還未完成工作就被以為是Error 直接將整個安裝中斷掉。</p><pre>hooks:<br>  ...<br>  activeDeadlineSeconds: 1000<br>  </pre><p><strong><em>f. system</em></strong></p><p>URL，在之後 Sentry 裡面的 project 所生成的 DSN 會解析回傳到此 URL，因此確保部屬的 Sentry (Ingress)的 hostname 與此 URL 一致，否則會收不到資料。<br>如果不確定可以先不設定，之後進web還可以設定。<br>如果再這邊設定完，之後就無法做更改了!</p><pre>system:<br>  url: &quot;https://sentry.&lt;your-domain&gt;&quot;</pre><p><strong><em>g. mail</em></strong></p><p>同user，password可以以secret的方式儲存，並將secret以及secret-key設定到value.yaml上。如果是使用gmail，推薦使用 <a href="https://support.google.com/accounts/answer/185833?hl=en">app password</a>，就算密碼外洩，也不會造成這麼大的損傷!</p><pre>kubectl create secret generic sentry-email-password --from-literal=email-password=&lt;app_password&gt; -n sentry</pre><p>host 是使用 google 的 <a href="https://support.google.com/a/answer/176600?hl=en">smtp.gmail.com</a><br>port 的部分，<a href="https://support.google.com/a/answer/176600?hl=en">如果有使用 Tls 為 587， Ssl 則為465，如果都不使用為 25</a><br>注意，Tls與Ssl只能擇一開啟，不能同時使用!</p><pre>mail:<br>  backend: smtp<br>  useTls: true<br>  useSsl: false<br>  username: this@is.email<br>  # password: <br>  existingSecret: sentry-email-password<br>  existingSecretKey: email-password<br>  port: 587<br>  host: smtp.gmail.com<br>  from: this@is.email<br></pre><p><strong><em>h. symbolicator</em></strong></p><pre>symbolicator<br>  enabled: true</pre><p><strong><em>i. service</em></strong></p><p>將 type 改為 NodePort</p><pre>service:<br>  name: sentry<br>  type: NodePort</pre><p><strong><em>j. nginx</em></strong></p><p>為了能讓 Ingress 順利導向 nginx，需要將 type 改為 NodePort</p><pre>nginx:<br>  ...<br>  service:<br>    type: NodePort<br>  ...</pre><p><strong><em>k. ingress</em></strong></p><p>我們使用 ALB 做為Ingress Controller。而因為使用Azure來管理domain，因此需要設alb.ingress.kubernetes.io/certificate-arn 讓ALB能夠獲取 CA。並且如果需要TLS，可以將Key以及Cert以Secret方式儲存至K8s</p><pre>kubectl create secret tls sentry-tls-secret --key ./tls.key --cert ./tls.pem</pre><pre>ingress:<br>  enabled: true<br>  regexPathStyle: aws-alb<br>  alb:<br>    httpRedirect: true<br>  annotations:<br>    kubernetes.io/ingress.class: alb<br>    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:&lt;region&gt;:&lt;id&gt;:certificate/xxx<br>    alb.ingress.kubernetes.io/scheme: internet-facing<br>    alb.ingress.kubernetes.io/subnets: subnet-xxx, subnet-xxx, subnet-xxx<br>    alb.ingress.kubernetes.io/target-type: ip<br>  # 注意要跟上方 System URL 一樣<br>  hostname: sentry.&lt;your-domain-name&gt;<br>  # additionalHostNames: []<br>  tls:<br>  - secretName: sentry-tls-secret<br>    hosts:<br>    - sentry.&lt;your-domain-name&gt;</pre><p>不過不知道為什麼設定 hostname後ingress就無法使用，需要在部屬後將hostname用edit方式從ingress刪除才能正常使用。<br>另外kubernetes.io/ingress.class 目前<a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation">已被替用</a>，需要在部屬後將 ingress class 改設定在 spec.ingressClassName (稍後在 step 5. 會重新設定)</p><p><strong><em>l. filestre</em></strong></p><p>因為使用EBS作為Storage Class，因此accessMode設為ReadWriteOnce</p><pre>filestore:<br>  backend: filesystem<br>  filesystem:<br>    path: /var/lib/sentry/files<br>    persistence:<br>      enabled: true<br>      accessMode: ReadWriteOnce<br>      size: 10Gi</pre><p><strong>以上，是比較需要注意的一些設定，其他設定可以依照個人情況做調整。</strong></p><p>3. 安裝 sentry</p><pre>helm install sentry sentry/sentry -n sentry -f ./values.yaml</pre><ul><li>sentry 是 apllication 的名稱，可以選一個自己想要的，之後update或是刪除都是以 apllication name指定。</li><li>sentry/sentry 是指定 repo，必須與上方相同</li><li>-n sentry 指定 app 要安裝在哪個 namesapce</li><li>-f ./values.yaml 是要用哪個設定檔安裝，記得使用在 step 2. 更改過後的檔案</li></ul><p>4. 檢查安裝情況</p><p>通常安裝時間會在 10 分鐘 ~ 15 分鐘左右會全部結束。<br>可以檢查整個namespace來看看是不是在什麼地方卡住了。<br>如果有不尋常的地方，可以先前往下一個章節，看看是不是出了什麼問題。</p><pre># 查看 Pods 以及 job 等狀況<br>kubectl get all -n sentry</pre><p>如果全部 Pods 都正常運行，且 job 也都執行完畢，則可以前往下一步。</p><p>如果出現 Pods 卡在 Pending、Container Creating 或是 job 卡在 0/1 抑或是 PVC 出現 unbounded 等問題，可以在先下一個章節找出原因。等問題都解決後再繼續進行設定。</p><p>5. 重新設定 ingress</p><p>檢查 ingresss，有沒有正常執行，如果 ingress address 有正常顯示 且可以正常連接至網站，則可以前往下一步。</p><pre>kubectl get ing -n sentry</pre><p>如果無法連接，沒有address或是無法找到網站，無法連接等等問題，就會需要重新設定 Ingress。<br>根據 step2 — ingress 所提到的問題，這邊會需要更改兩個部分。<br>開啟編輯頁面</p><pre>kubectl edit ing sentry -n sentry</pre><p>新增 spec.ingressClassName，以及移除 spec.rules.host</p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  annotations:<br>    ...<br>    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:&lt;region&gt;:&lt;id&gt;:certificate/xxx<br>    alb.ingress.kubernetes.io/scheme: internet-facing<br>    alb.ingress.kubernetes.io/subnets: subnet-xxx, subnet-xxx, subnet-xxx<br>    alb.ingress.kubernetes.io/target-type: ip<br>    kubernetes.io/ingress.class: alb<br>    ...<br>spec:<br>  # add ingressClassName<br>  ingressClassName: alb<br>  rules:<br>  # remove - host &amp; add dash before host<br>  # - host: sentry.&lt;your-domain-name&gt;<br>  - http:<br>      paths:<br>      - backend:<br>          service:<br>            name: sentry-nginx<br>            port:<br>              number: 80<br>        path: /<br>        pathType: Prefix<br>  tls:<br>  - hosts:<br>    - sentry.&lt;your-domain-name&gt;<br>    secretName: sentry-tls-secret<br>...</pre><p>5. 綁定 hostname</p><p>如果都沒有問題，就可以將ingress的address以CNAME綁定到hostname上</p><pre>kubectl.exe get ing -n sentry</pre><p>6. 使用 Sentry</p><p>使用 step 2. 設定的 user 就可以登入使用了!</p><h3>常見錯誤及解決方法</h3><p>在第一次安裝可能會遇到許多問題，可以藉由<br>獲取各物件(Pods/Job)狀態，查看問題點所在</p><pre>kubectl get all -n sentry</pre><p>檢查PVC運作</p><pre>kubectl get pvc -n sentry</pre><p>檢查Ingress</p><pre>kubectl get ing -n sentry</pre><p>獲取 events</p><pre>kubectl describe &lt;resource-type&gt; &lt;resoure-name&gt; -n sentry<br># kubectl describe pods sentry-web-xxx -n sentry </pre><p>或取 logs</p><pre>kubectl logs &lt;pods-name&gt; -n sentry (--since=1h)</pre><p>獲取namespace的events</p><pre>kubectl get events -n sentry  </pre><p><strong><em>在執行 Helm install 時，CMD出現下列錯誤</em></strong></p><pre>Error: INSTALLATION FAILED: repo sentry not found</pre><p>這是因為尚未新增sentry的repo至helm，只要將repo新增上去即可解決。</p><p><strong><em>安裝無法正常運行，Pods 卡在 Pending，Desribe Pods出現</em></strong></p><pre>... 0/4 nodes are available ...</pre><p>因為Pods數量不夠，已到達node上限，須提供更多 Pods (node) 後會繼續執行。或是<a href="https://docs.aws.amazon.com/zh_tw/eks/latest/userguide/cni-increase-ip-addresses.html">調高 node 的 Pods limit</a>。</p><p>*以預設設定檔安裝Sentry最少會需要54個Pods</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsheetsu.com%2Ftables%2F004c13ecde&amp;dntp=1&amp;display_name=Sheetsu&amp;url=https%3A%2F%2Fsheetsu.com%2Ftables%2F004c13ecde&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=sheetsu" width="700" height="467" frameborder="0" scrolling="no"><a href="https://medium.com/media/abfc9ed9e40ad4721835dddca3e1dc0d/href">https://medium.com/media/abfc9ed9e40ad4721835dddca3e1dc0d/href</a></iframe><p><a href="https://docs.google.com/spreadsheets/d/1ohrCR3Pto9al3IwRZSiMtw_p6O2EsGauznL3vQ_VfJE/edit?usp=sharing">Sentry Replicas Count</a></p><p>AWS EKS Node 的 Pods 上限計算(<a href="https://github.com/awslabs/amazon-eks-ami/blob/master/files/eni-max-pods.txt">清單</a>)</p><pre>N * (M-1) + 2</pre><ul><li>N is the number of Elastic Network Interfaces (ENI) of the instance type</li><li>M is the number of IP addresses of a single ENI</li></ul><p>而ENI及IP address數量<a href="https://docs.aws.amazon.com/zh_tw/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI">可由此得知</a></p><p><strong><em>Pods 出現空間不足，PVC 卡在 waiting，Describe PVC 出現錯誤訊息</em></strong></p><pre>waiting for a volume to be created, either by external provisioner “ebs.csi.aws.com”’</pre><p>在 AWS EKS v1.23 版本後，就<a href="https://docs.aws.amazon.com/zh_tw/eks/latest/userguide/ebs-csi-migration-faq.html">不再預設支援 PVC 創建 PV</a>，需要額外安裝</p><p><a href="https://docs.aws.amazon.com/zh_tw/eks/latest/userguide/ebs-csi.html">EBS CSI</a>，在安裝後，就可以解決問題</p><p><strong><em>Mail 無法正常發送，Log Worker出現錯誤</em></strong></p><ul><li>EMAIL或密碼錯誤</li><li>有可能是設定 Tls 與 Ssl 同時為 true 導致錯誤</li><li>backend 未設定為 smtp</li><li>Port 設定錯誤</li></ul><p><strong><em>再刪除專案時卡在terminating，無法刪除 Ingress</em></strong></p><p>因為 Ingress Finalizer 的問題，將finalizers移除即可</p><pre>kubectl.exe patch -n sentry ing/sentry --type=json --patch=&#39;[{&quot;op&quot;: &quot;remove&quot;, &quot;path&quot;: &quot;/metadata/finalizers&quot;}]&#39;</pre><p>或是</p><pre>kubectl edit ing sentry -n sentry</pre><p>移除 metadata.finalizers</p><p><strong><em>Ingress 無法執行 sts:AssumeRoleWithWebIdentity</em></strong></p><pre>Failed build model due to WebIdentityErr: failed to retrieve credentials<br>caused by: AccessDenied: Not authorized to perform sts:AssumeRoleWithWebIdentity</pre><p>重新設定 TrustRelation 及可</p><p><a href="https://repost.aws/knowledge-center/eks-load-balancer-webidentityerr">Troubleshoot a &quot;webidentityerr&quot; error in Amazon EKS</a></p><p>Ingress 無法執行 elasticloadbalancing:AddTags</p><pre>ingress  Failed deploy model due to AccessDenied: User: arn:aws:sts::&lt;id&gt;:assumed-role/&lt;role&gt;/xxx is not authorized to perform: elasticloadbalancing:AddTags on resource: arn:aws:elasticloadbalancing:&lt;region&gt;:&lt;id&gt;:targetgroup/&lt;group&gt;/* because no identity-based policy allows the elasticloadbalancing:AddTags action</pre><p>新增相關權限即可</p><p><a href="https://docs.aws.amazon.com/zh_tw/elasticloadbalancing/latest/userguide/tagging-resources-during-creation.html">彈性負載平衡 API 權限，可在建立期間標記資源</a></p><p><strong><em>Log Web 缺少 Column</em></strong></p><p>這是因為未成功初始化資料庫，需要進入web的pods使用指令運行migration。</p><pre>kubectl exec -it sentry-web-xxx-xxx -n sentry -- /bin/bash</pre><p>在執行</p><pre>sentry upgrade</pre><p>Web 無法登入</p><p>在創建user的時候發生錯誤，一樣要進入web的pods使用指令創建新的使用者。</p><pre>kubectl exec -it sentry-web-xxx-xxx -n sentry -- /bin/bash</pre><pre>sentry createuser</pre><p>以上</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc255e0e31e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>