Join my course at Udemy (Python Programming Bible-From beginner to advanced )

Blogger templates

Tuesday, 7 January 2025

44/45. Env / ConfigMaps

44. Env variables

ENV variables can be defined under ENV 



Other ways to define ENV variables

  • config-map - Value is taken from outside
  • Secrets - Value is taken from outside.




ConfigMaps

When there are too many ENV files then it is better to define all variables in a seperate file in KEY/VALUE format.

How to create config-maps ( 2 ways ) 

- imperative and declarative.




Imperative way to create config-map






Declarative way for config-map




View Configmap




Config map in yaml file



Different ways of config-map






Share:

37/38/40. Container Images

37. Define, Build and Modify Container Images.

Why ?

Created one application and we want to dockerize the application.

What are the steps if we have to deploy our application manually ?

- Deploy OS
- Update apt repo
- Install dependency using apt
- Install python dependency using pip
- Copy source folder to /opt
- Run web server using flask command.

Docker file with file name = <file-name>

FROM Ubuntu   [FROM -> Instruction, Ubuntu->Argument] <---- Install OS

RUN apt-get update                                   <------------ Install Dependencies
RUN apt-get install python

RUN pip install flask
RUN pip install flask-mysql

COPY . /opt/source-code                         <--- Copy source Code.

ENTRYPOINT FLASK_APP=/opt/source-code/app.py flask run   <-- Specify Entry Point.


Build docker

docker build <docker-file> -t <TAG>

PUSH Docker

docker push <TAG>

38. Command and Arguments in Docker ( CMD, ENTRYPOINT )






40. Command and Argument in K8















Share:

Feature Top (Full Width)

Pageviews

Search This Blog