https://github.com/ewertoncodes/kubernetes
Kubernetes Course
https://github.com/ewertoncodes/kubernetes
kubernetes
Last synced: about 18 hours ago
JSON representation
Kubernetes Course
- Host: GitHub
- URL: https://github.com/ewertoncodes/kubernetes
- Owner: ewertoncodes
- Created: 2019-08-05T14:02:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-05T23:21:38.000Z (almost 7 years ago)
- Last Synced: 2025-07-18T02:50:19.686Z (11 months ago)
- Topics: kubernetes
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kubernetes Course
**Install VirtualBox**
[Virtualbox](https://www.virtualbox.org/wiki/Linux_Downloads)
**Install Minikube**
Install curl:
```
sudo apt-get install curl
```
Open the terminal and type this command:
```
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && sudo chmod +x minikube && sudo mv minikube /usr/local/bin/
```
**Install kubectl**
```
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
```
```
chmod +x ./kubectl
```
```
sudo mv ./kubectl /usr/local/bin/kubectl
```
clone the repo:
```
git clone https://github.com/ewertoncodes/kubernetes.git
```
**Database**
```bash
$ minikube start
$ cd kubernetes/db/
$ kubectl create -f statefulset.yaml
$ kubectl create -f servico-banco.yaml
$ kubectl create -f permissoes.yaml
$ kubectl get pods
$ kubectl exec -it [mysql pod name] sh
# mysql -u root
mysql> use loja
```
Paste the **Mysql** script:
```
create table produtos (id integer auto_increment primary key, nome varchar(255), preco decimal(10,2));
alter table produtos add column usado boolean default false;
alter table produtos add column descricao varchar(255);
create table categorias (id integer auto_increment primary key, nome varchar(255));
insert into categorias (nome) values ("Futebol"), ("Volei"), ("Tenis");
alter table produtos add column categoria_id integer;
update produtos set categoria_id = 1;
```
**Application**
```
$ cd kubernetes/app/
$ kubectl create -f deployment.yaml
$ kubectl create -f servico-aplicacao.yaml
$ kubectl scale deployment aplicacao-deployment --replicas=3
$ kubectl get pods
$ minikube service servico-aplicacao --url
```