<p>I am practicing k8s from <a href="https://www.katacoda.com/courses/kubernetes/create-kubernetes-ingress-routes" rel="nofollow noreferrer">katacoda</a>. Currently I am working on <code>ingress.yaml</code>. This is chapter has extra kind of services come to the <code>yaml</code> file. They are <code>Namespace, Secret, ServiceAccount, and ConfigMap</code>.
For <code>Secret</code> I can read on other chapter to understand it later.</p>

<p><strong>Questions:</strong><br></p>

<ol>
<li><p>Do I need to use <code>Namespace, ServiceAccount, and ConfigMap</code> in my <code>ingress.yaml</code>?</p></li>
<li><p>Suppose I <code>Caddy</code> to make <code>https</code>. <code>Secret</code> from the example is a hardcode. How can I achieve automatically renew after certain period?</p></li>
</ol>

joe
<blockquote>
  <p>Do I need to use Namespace, ServiceAccount, and ConfigMap in my ingress.yaml?</p>
</blockquote>

<p>No, it's not required. They are different Kubernetes resources and can be created independently. But you can place several resource definition in one YAML file just for convenience. </p>

<p>Alternatively you can create separate YAML file for each resource and place them all in the same directory. After that one of the following commands can be used to create resources <a href="https://kubernetes.io/docs/concepts/cluster-administration/manage-deployment/#bulk-operations-in-kubectl" rel="nofollow noreferrer">in bulk</a>:</p>

<pre><code>kubectl create -f project/k8s/development
kubectl create -f project/k8s/development --recursive
</code></pre>

<p><a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" rel="nofollow noreferrer"><strong>Namespace</strong></a> is just a placeholder for Kubernetes resources. It should be created before any other resources use it.</p>

<p><a href="https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/" rel="nofollow noreferrer"><strong>ServiceAccount</strong></a> is used as a security context to restrict permission for specific automation operations.</p>

<p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/" rel="nofollow noreferrer"><strong>ConfigMap</strong></a> is used as a node independent source of configuration/file/environment for pods.</p>

<hr>

<blockquote>
  <p>Suppose I Caddy to make https. Secret from the example is a hardcode. How can I achieve automatically renew after certain period?</p>
</blockquote>

<p>Not quite clear question, but I believe you can use cert-manager for that. </p>

<p><a href="https://docs.cert-manager.io/en/latest/" rel="nofollow noreferrer"><strong>cert-manager</strong></a> is quite popular solution to manage certificates for Kubernetes cluster.</p>
