Commit 7c7040f1 authored by Marcones Silva's avatar Marcones Silva

Execicrio cap 5 network-sdn, arquivo deployment

parent 2ebf57a0
DROP TABLE IF EXISTS `Item`;
CREATE TABLE `Item` (`id` BIGINT not null auto_increment primary key, `description` VARCHAR(100), `done` BIT);
INSERT INTO `Item` (`id`,`description`,`done`) VALUES (1,'Pick up newspaper', 0);
INSERT INTO `Item` (`id`,`description`,`done`) VALUES (2,'Buy groceries', 1);
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
labels:
app: todonodejs
name: mysql
spec:
replicas: 1
selector:
matchLabels:
app: todonodejs
name: mysql
template:
metadata:
labels:
app: todonodejs
name: mysql
spec:
containers:
- image: quay.io/centos7/mysql-80-centos7:8.0
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: r00tpa55
- name: MYSQL_USER
value: user1
- name: MYSQL_PASSWORD
value: mypa55
- name: MYSQL_DATABASE
value: items
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- mountPath: "/var/lib/mysql"
name: db-volume
volumes:
- name: db-volume
emptyDir: {}
- name: db-init
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
labels:
app: todonodejs
name: mysql
name: mysql
spec:
ports:
- port: 3306
selector:
name: mysql
\ No newline at end of file
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
labels:
app: todonodejs
name: frontend
namespace: network-sdn
spec:
replicas: 1
selector:
matchLabels:
app: todonodejs
name: frontend
template:
metadata:
labels:
app: todonodejs
name: frontend
spec:
containers:
- resources:
limits:
cpu: '0.5'
image: quay.io/redhattraining/todo-single:v1.0
name: todonodejs
ports:
- containerPort: 8080
name: nodejs-http
env:
- name: MYSQL_ENV_MYSQL_DATABASE
value: items
- name: MYSQL_ENV_MYSQL_USER
value: user1
- name: MYSQL_ENV_MYSQL_PASSWORD
value: mypa55
- name: APP_PORT
value: '8080'
---
apiVersion: v1
kind: Service
metadata:
labels:
app: todonodejs
name: frontend
name: frontend
spec:
ports:
- port: 8080
selector:
name: api
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment