Skip to content

Latest commit

 

History

History
69 lines (61 loc) · 1.57 KB

readme-samples.md

File metadata and controls

69 lines (61 loc) · 1.57 KB

install virtual python environment

pip install virtualenv
virtualenv umngtven
source umngtven/bin/activate
pip install Flask mysql-connector-python
# run flask app
python app.py
kubectl exec -it mysql-745ccb4959-cg2x2 -- mysql -u root -p
###
USE demo;

CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(50) NOT NULL,
    password VARCHAR(50) NOT NULL
);

INSERT INTO users (username, password) VALUES ('tharanga', 'tharanga');

docker build -t my-flask-app .
docker run -d -p 5000:5000 my-flask-app
docker tag my-flask-app:latest dtl1976/my-flask-app:latest
docker push dtl1976/my-flask-app:latest

minikube service flask-app-service

###

commands

check existing ssh keys

ls -al ~/.ssh

generate new ssh key

ssh-keygen -t rsa -b 4096 -C "[email protected]"

copy ssh key to clipboard

cat ~/.ssh/id_rsa.pub

build image and publish to docker hub

docker build -t my-flask-app .
docker run -d -p 5000:5000 my-flask-app
docker tag my-flask-app:latest dtl1976/my-flask-app:latest
docker push dtl1976/my-flask-app:latest

minikube service flask-app-service
helm create my-flask-chart
helm package my-flask-chart
helm install my-flask-release my-flask-chart/
helm list
helm uninstall <release-name> -n <namespace>
## Override values in value.yaml
helm install my-flask-app ./my-flask-app-chart --set replicaCount=2 --set mysql.user=myuser --set mysql.password=mypassword
```bash

# encoding decoding options
```bash
echo -n 'demo_user' | base64
echo -n 'demo@1234' | base64
```bash