Deploy GitHub Pages

This commit is contained in:
k8s-ci-robot 2021-11-28 21:12:19 +00:00
parent e2c1e93055
commit 02cf70e8fc
20 changed files with 67 additions and 67 deletions

View file

@ -25,13 +25,13 @@ Do not move it without providing redirects.
<span class=go>Events:</span>
<span class=go> Type Reason Age From Message</span>
<span class=go> ---- ------ ---- ---- -------</span>
<span class=go> Normal CREATE 1m nginx-ingress-controller Ingress default/cafe-ingress</span>
<span class=go> Normal UPDATE 58s nginx-ingress-controller Ingress default/cafe-ingress</span>
<span class=go> Normal CREATE 1m ingress-nginx-controller Ingress default/cafe-ingress</span>
<span class=go> Normal UPDATE 58s ingress-nginx-controller Ingress default/cafe-ingress</span>
</code></pre></div> <p>Check the Ingress Controller Logs</p> <div class=highlight><pre><span></span><code><span class=gp>$</span> kubectl get pods -n &lt;namespace-of-ingress-controller&gt;
<span class=go>NAME READY STATUS RESTARTS AGE</span>
<span class=go>nginx-ingress-controller-67956bf89d-fv58j 1/1 Running 0 1m</span>
<span class=go>ingress-nginx-controller-67956bf89d-fv58j 1/1 Running 0 1m</span>
<span class=gp>$</span> kubectl logs -n &lt;namespace&gt; nginx-ingress-controller-67956bf89d-fv58j
<span class=gp>$</span> kubectl logs -n &lt;namespace&gt; ingress-nginx-controller-67956bf89d-fv58j
<span class=go>-------------------------------------------------------------------------------</span>
<span class=go>NGINX Ingress controller</span>
<span class=go> Release: 0.14.0</span>
@ -41,9 +41,9 @@ Do not move it without providing redirects.
<span class=go>....</span>
</code></pre></div> <p>Check the Nginx Configuration</p> <div class=highlight><pre><span></span><code><span class=gp>$</span> kubectl get pods -n &lt;namespace-of-ingress-controller&gt;
<span class=go>NAME READY STATUS RESTARTS AGE</span>
<span class=go>nginx-ingress-controller-67956bf89d-fv58j 1/1 Running 0 1m</span>
<span class=go>ingress-nginx-controller-67956bf89d-fv58j 1/1 Running 0 1m</span>
<span class=gp>$</span> kubectl <span class=nb>exec</span> -it -n &lt;namespace-of-ingress-controller&gt; nginx-ingress-controller-67956bf89d-fv58j -- cat /etc/nginx/nginx.conf
<span class=gp>$</span> kubectl <span class=nb>exec</span> -it -n &lt;namespace-of-ingress-controller&gt; ingress-nginx-controller-67956bf89d-fv58j -- cat /etc/nginx/nginx.conf
<span class=go>daemon off;</span>
<span class=go>worker_processes 2;</span>
<span class=go>pid /run/nginx.pid;</span>
@ -67,9 +67,9 @@ Do not move it without providing redirects.
</code></pre></div> <h2 id=debug-logging>Debug Logging<a class=headerlink href=#debug-logging title="Permanent link"></a></h2> <p>Using the flag <code>--v=XX</code> it is possible to increase the level of logging. This is performed by editing the deployment.</p> <div class=highlight><pre><span></span><code><span class=gp>$</span> kubectl get deploy -n &lt;namespace-of-ingress-controller&gt;
<span class=go>NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE</span>
<span class=go>default-http-backend 1 1 1 1 35m</span>
<span class=go>nginx-ingress-controller 1 1 1 1 35m</span>
<span class=go>ingress-nginx-controller 1 1 1 1 35m</span>
<span class=gp>$</span> kubectl edit deploy -n &lt;namespace-of-ingress-controller&gt; nginx-ingress-controller
<span class=gp>$</span> kubectl edit deploy -n &lt;namespace-of-ingress-controller&gt; ingress-nginx-controller
<span class=gp>#</span> Add --v<span class=o>=</span>X to <span class=s2>&quot;- args&quot;</span>, where X is an integer
</code></pre></div> <ul> <li><code>--v=2</code> shows details using <code>diff</code> about the changes in the configuration in nginx</li> <li><code>--v=3</code> shows details about the service, Ingress rule, endpoint changes and it dumps the nginx configuration in JSON format</li> <li><code>--v=5</code> configures NGINX in <a href=http://nginx.org/en/docs/debugging_log.html>debug mode</a></li> </ul> <h2 id=authentication-to-the-kubernetes-api-server>Authentication to the Kubernetes API Server<a class=headerlink href=#authentication-to-the-kubernetes-api-server title="Permanent link"></a></h2> <p>A number of components are involved in the authentication process and the first step is to narrow down the source of the problem, namely whether it is a problem with service authentication or with the kubeconfig file.</p> <p>Both authentications must work:</p> <div class=highlight><pre><span></span><code>+-------------+ service +------------+
| | authentication | |
@ -136,15 +136,15 @@ Do not move it without providing redirects.
<span class=gp>#</span> when you <span class=nb>type</span> <span class=sb>`</span><span class=nb>exit</span><span class=sb>`</span> or <span class=sb>`</span>^D<span class=sb>`</span> the <span class=nb>test</span> pod will be deleted.
</code></pre></div> <p>If it is not working, there are two possible reasons:</p> <ol> <li> <p>The contents of the tokens are invalid. Find the secret name with <code>kubectl get secrets | grep service-account</code> and delete it with <code>kubectl delete secret &lt;name&gt;</code>. It will automatically be recreated.</p> </li> <li> <p>You have a non-standard Kubernetes installation and the file containing the token may not be present. The API server will mount a volume containing this file, but only if the API server is configured to use the ServiceAccount admission controller. If you experience this error, verify that your API server is using the ServiceAccount admission controller. If you are configuring the API server by hand, you can set this with the <code>--admission-control</code> parameter.</p> <blockquote> <p>Note that you should use other admission controllers as well. Before configuring this option, you should read about admission controllers.</p> </blockquote> </li> </ol> <p>More information:</p> <ul> <li><a href=http://kubernetes.io/docs/user-guide/service-accounts/ >User Guide: Service Accounts</a></li> <li><a href=http://kubernetes.io/docs/admin/service-accounts-admin/ >Cluster Administrator Guide: Managing Service Accounts</a></li> </ul> <h2 id=kube-config>Kube-Config<a class=headerlink href=#kube-config title="Permanent link"></a></h2> <p>If you want to use a kubeconfig file for authentication, follow the <a href=../deploy/ >deploy procedure</a> and add the flag <code>--kubeconfig=/etc/kubernetes/kubeconfig.yaml</code> to the args section of the deployment.</p> <h2 id=using-gdb-with-nginx>Using GDB with Nginx<a class=headerlink href=#using-gdb-with-nginx title="Permanent link"></a></h2> <p><a href=https://www.gnu.org/software/gdb/ >Gdb</a> can be used to with nginx to perform a configuration dump. This allows us to see which configuration is being used, as well as older configurations.</p> <p>Note: The below is based on the nginx <a href=https://docs.nginx.com/nginx/admin-guide/monitoring/debugging/#dumping-nginx-configuration-from-a-running-process>documentation</a>.</p> <ol> <li>SSH into the worker</li> </ol> <div class=highlight><pre><span></span><code><span class=gp>$</span> ssh user@workerIP
</code></pre></div> <ol> <li>Obtain the Docker Container Running nginx</li> </ol> <div class=highlight><pre><span></span><code><span class=gp>$</span> docker ps <span class=p>|</span> grep nginx-ingress-controller
</code></pre></div> <ol> <li>Obtain the Docker Container Running nginx</li> </ol> <div class=highlight><pre><span></span><code><span class=gp>$</span> docker ps <span class=p>|</span> grep ingress-nginx-controller
<span class=go>CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</span>
<span class=go>d9e1d243156a quay.io/kubernetes-ingress-controller/nginx-ingress-controller &quot;/usr/bin/dumb-init …&quot; 19 minutes ago Up 19 minutes k8s_nginx-ingress-controller_nginx-ingress-controller-67956bf89d-mqxzt_kube-system_079f31ec-aa37-11e8-ad39-080027a227db_0</span>
<span class=go>d9e1d243156a k8s.gcr.io/ingress-nginx/controller &quot;/usr/bin/dumb-init …&quot; 19 minutes ago Up 19 minutes k8s_ingress-nginx-controller_ingress-nginx-controller-67956bf89d-mqxzt_kube-system_079f31ec-aa37-11e8-ad39-080027a227db_0</span>
</code></pre></div> <ol> <li>Exec into the container</li> </ol> <div class=highlight><pre><span></span><code><span class=gp>$</span> docker <span class=nb>exec</span> -it --user<span class=o>=</span><span class=m>0</span> --privileged d9e1d243156a bash
</code></pre></div> <ol> <li>Make sure nginx is running in <code>--with-debug</code></li> </ol> <div class=highlight><pre><span></span><code><span class=gp>$</span> nginx -V <span class=m>2</span>&gt;<span class=p>&amp;</span><span class=m>1</span> <span class=p>|</span> grep -- <span class=s1>&#39;--with-debug&#39;</span>
</code></pre></div> <ol> <li>Get list of processes running on container</li> </ol> <div class=highlight><pre><span></span><code><span class=gp>$</span> ps -ef
<span class=go>UID PID PPID C STIME TTY TIME CMD</span>
<span class=go>root 1 0 0 20:23 ? 00:00:00 /usr/bin/dumb-init /nginx-ingres</span>
<span class=go>root 5 1 0 20:23 ? 00:00:05 /nginx-ingress-controller --defa</span>
<span class=go>root 5 1 0 20:23 ? 00:00:05 /ingress-nginx-controller --defa</span>
<span class=go>root 21 5 0 20:23 ? 00:00:00 nginx: master process /usr/sbin/</span>
<span class=go>nobody 106 21 0 20:23 ? 00:00:00 nginx: worker process</span>
<span class=go>nobody 107 21 0 20:23 ? 00:00:00 nginx: worker process</span>