Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .suite-cli/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microservices-suite/cli",
"version": "3.1.0",
"version": "3.1.1",
"description": "This is the CLI tool for running the microservices-suite monorepo. It contains functionalities and tools required for automation and managing the repo across supported platforms. Works on Windows,MacOS and Linux as well as support to some extend other variants like SunOS, IBM AIX, FreeBSD, OpenBSD and more",
"main": "cli.js",
"repository": "https://github.com/microservices-suite/node-microservices-suite.git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = ({ answers }) => (
`tests/${answers.service_name}/unit`,
`tests/${answers.service_name}/snapshot`,
`microservices`,
`k8s/${answers.service_name}`,
`k8s`,
`docker/apps`,
...(answers.apis.map((api) => `${api}/app1`)),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = ({ answers, suffix, isMicroservice, description, os, addDeps })
dependencies: {
[`${answers.project_base}/config`]: "1.0.0",
[`${answers.project_base}/errors`]: "1.0.0",
[`${answers.project_base}/utilities`]: "1.0.7",
[`${answers.project_base}/utilities`]: "1.0.0",
[`${answers.project_base}/broker`]: "1.0.0",
dotenv: "^16.4.5",
express: "^4.18.3",
Expand Down
10 changes: 3 additions & 7 deletions .suite-cli/cli/scripts/scripts.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -1026,14 +1026,9 @@ const addMicroservice = ({ project_root, answers }) => {
case `GraphQL/app1`:
writeFile(join(current_dir, 'appollo-server.js'), assets.apolloServerContent({ answers }));
break;
case `k8s/${answers.service_name}`:
// TODO: move k8s into a function
writeFile(join(current_dir, 'client-node-port.yaml'), assets.k8sClientNodeContent());
writeFile(join(current_dir, 'client-pod.yaml'), assets.k8sClientPodContent());
writeFile(join(current_dir, 'cluster-deployment.yml'), assets.k8sClusterDeploymentContent());
case `k8s`:
// TODO: move k8s into a function
writeFile(join(current_dir, 'README.md'), assets.k8sReadmeContent({ answers }));
writeFile(join(current_dir, 'cluster-ip-service.yml'), assets.k8sClusterIpServiceContent());
writeFile(join(current_dir, 'ingress-service.yml'), assets.k8sIngressServiceContent());
break;
}
});
Expand Down Expand Up @@ -1076,6 +1071,7 @@ const scaffoldNewRepo = async ({ answers }) => {
addProjectConfigs({ project_root: join(cwd(), answers.repo_name), answers })
addMicroservice({ project_root: join(cwd(), answers.repo_name), answers })
addPackageJson({ project_root: join(cwd(), answers.repo_name), answers })

return
}
else {
Expand Down
24 changes: 24 additions & 0 deletions istio/virtual-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: api-vs
spec:
hosts:
- api.cloudacademy.35.88.67.205.nip.io
gateways:
- api-gateway
http:
- route:
- destination:
host: api.default.svc.cluster.local
subset: v1
port:
number: 80
weight: 25
- destination:
host: api.default.svc.cluster.local
subset: v2
port:
number: 80
weight: 75

60 changes: 60 additions & 0 deletions mysq.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: mysql-config
labels:
app: mysql
data:
MYSQL_ROOT_PASSWORD: "CloudAcademy!"
MYSQL_PASSWORD: "CloudAcademy!"
MYSQL_USER: "api_user"
MYSQL_DATABASE: "orders"
---
apiVersion: v1
kind: Service
metadata:
name: mysql
labels:
app: mysql
spec:
ports:
- port: 3306
name: mysql
clusterIP: None
selector:
app: mysql
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
spec:
selector:
matchLabels:
app: mysql
serviceName: "mysql"
replicas: 1
template:
metadata:
labels:
app: mysql
spec:
terminationGracePeriodSeconds: 10
containers:
- name: mysql
image: public.ecr.aws/cloudacademy-labs/cloudacademy/labs/k8s-assessment/mysql:8
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql
mountPath: /var/lib/mysql
envFrom:
- configMapRef:
name: mysql-config
volumes:
- name: mysql
hostPath:
path: /tmp/mysql/
type: Directory