<p>I am very new to K8s, so I didn't use it ever. But I had familiarized myself with the concept of nodes/pods. I know that minikube is the local k8s engine for debug/etc and that I should interact with any k8s engine via kubectl tool. Now my questions are:</p>

<ol>
<li><p>Does launching the same configuration on my local minikube instance and production AWS/etc instance guarantee that the result will be identic?</p></li>
<li><p>How do I set up continuous deployment for my project? Now I have configured CI that pushes images of tested code to the docker hub with the <code>:latest</code> tag. But I want them to be automatically deployed in the Rolling Update mode without interrupting uptime.</p></li>
<li><p>It would be great to get correct configurations with the steps I should perform to make it work on any cluster? I don't want to save docker-compose's notation and use kompose. I want to make it properly in the k8s context.</p></li>
</ol>

<p>My current docker-compose.yml is (django and react services are available from dockerhub now):</p>

<pre><code>version: "3.5"
services:
  nginx:
    build:
      context: .
      dockerfile: Dockerfile.nginx
    restart: always
    command: bash -c "service nginx start &amp;&amp; tail -f /dev/null"
    ports:
      - 80:80
      - 443:443
    volumes:
      - /mnt/wts_new_data_volume/static:/data/django/static
      - /mnt/wts_new_data_volume/media:/data/django/media
      - ./certs:/etc/letsencrypt/
      - ./misc/ssl/server.crt:/etc/ssl/certs/server.crt
      - ./misc/ssl/server.key:/etc/ssl/private/server.key
      - ./misc/conf/nginx.conf:/etc/nginx/nginx.conf:ro
      - ./misc/conf/passports.htaccess:/etc/passports.htaccess:ro
    depends_on:
      - react
  redis:
    restart: always
    image: redis:latest
    privileged: true
    command: redis-server
  celery:
    build:
      context: backend
    command: bash -c "celery -A project worker -B -l info"
    env_file:
      - ./misc/.env
    depends_on:
      - redis
  django:
    build:
      context: backend
    command: bash -c "/code/manage.py collectstatic --no-input &amp;&amp; echo donecollectstatic &amp;&amp; /code/manage.py migrate &amp;&amp; bash /code/run/daphne.sh"
    volumes:
      - /mnt/wts_new_data_volume/static:/data/django/static
      - /mnt/wts_new_data_volume/media:/data/django/media
    env_file:
      - ./misc/.env
    depends_on:
      - redis
  react:
    build:
      context: frontend
    depends_on:
      - django
</code></pre>

<p>The short answer is yes, you can replicate what you have with docker-compose with K8s.</p>

<ol>
<li><p>It depends on your infrastructure. For example if you have an external <a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer" rel="nofollow noreferrer">LoadBalancer</a> in your AWS deployment, it won't be the same in your local.</p></li>
<li><p>You can do <a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/update/update-intro/" rel="nofollow noreferrer">rolling updates</a> (this typically works with stateless services). You can also take advantage of a <a href="https://www.weave.works/technologies/gitops/" rel="nofollow noreferrer">GitOps</a> type of approach.</p></li>
<li><p>The docker-compose notation is different from K8s so yes, you'll have to translate that to Kubernetes objects: Pods, Deployments, Secrets, ConfigMaps, Volumes, etc and for the most part the basic objects will work on any cluster, but there will always be some specific objects related to the physical characteristics of your cluster (i.e storage volumes, load balancer, etc). The <a href="https://kubernetes.io/docs/home/" rel="nofollow noreferrer">Kubernetes docs</a> are very comprehensive and are super helpful.</p></li>
</ol>
