-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from vany0114/k8s
K8s
- Loading branch information
Showing
158 changed files
with
668 additions
and
7,537 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: admin-user | ||
namespace: kubernetes-dashboard | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: admin-user | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: cluster-admin | ||
subjects: | ||
- kind: ServiceAccount | ||
name: admin-user | ||
namespace: kubernetes-dashboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: payment | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: payment | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: payment | ||
spec: | ||
containers: | ||
- name: payment | ||
image: vany0114/externalsystem.paymentservice | ||
imagePullPolicy: Always | ||
env: | ||
- name: ASPNETCORE_ENVIRONMENT | ||
value: "Development" | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: payment | ||
spec: | ||
selector: | ||
app: payment | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 80 | ||
targetPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: invoice | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: invoice | ||
replicas: 3 | ||
template: | ||
metadata: | ||
labels: | ||
app: invoice | ||
spec: | ||
containers: | ||
- name: invoice | ||
image: vany0114/duber.invoice.api | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
memory: "128Mi" | ||
cpu: "100m" | ||
limits: | ||
memory: "256Mi" | ||
cpu: "500m" | ||
env: | ||
- name: ASPNETCORE_ENVIRONMENT | ||
value: "Development" | ||
- name: ConnectionStrings__InvoiceDB | ||
value: "Server=sql-data;Database=Duber.InvoiceDb;User Id=sa;Password=Pass@word" | ||
- name: EventBusConnection | ||
value: "rabbitmq" | ||
- name: PaymentServiceBaseUrl | ||
value: "http://payment" | ||
- name: AzureServiceBusEnabled | ||
value: "False" | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: invoice | ||
spec: | ||
rules: | ||
- host: invoice.local.com | ||
http: | ||
paths: | ||
- path: / | ||
backend: | ||
serviceName: invoice | ||
servicePort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: invoice | ||
spec: | ||
selector: | ||
app: invoice | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 80 | ||
targetPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# to expose the port in order to connect with an IDE such as Studio 3T, etc | ||
|
||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: mongo-service | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: nosql-data | ||
ports: | ||
- port: 27017 | ||
nodePort: 31434 | ||
name: mongo-port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nosql-data | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: nosql-data | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: nosql-data | ||
spec: | ||
containers: | ||
- name: nosql-data | ||
image: mongo | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- name: http | ||
containerPort: 27017 | ||
protocol: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: nosql-data | ||
spec: | ||
selector: | ||
app: nosql-data | ||
ports: | ||
- port: 27017 | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
type: ClusterIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: ingress-nginx | ||
namespace: ingress-nginx | ||
labels: | ||
app.kubernetes.io/name: ingress-nginx | ||
app.kubernetes.io/part-of: ingress-nginx | ||
spec: | ||
externalTrafficPolicy: Local | ||
type: LoadBalancer | ||
selector: | ||
app.kubernetes.io/name: ingress-nginx | ||
app.kubernetes.io/part-of: ingress-nginx | ||
ports: | ||
- name: http | ||
port: 81 | ||
protocol: TCP | ||
targetPort: http | ||
- name: https | ||
port: 444 | ||
protocol: TCP | ||
targetPort: https |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# to expose the port in order to connect to the admin dashboard. | ||
|
||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: rabbitmq-admin | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: rabbitmq | ||
ports: | ||
- port: 15672 | ||
nodePort: 31672 | ||
name: rabbitmq-port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: rabbitmq | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: rabbitmq | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: rabbitmq | ||
spec: | ||
containers: | ||
- name: rabbitmq | ||
image: rabbitmq:3-management | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- name: http | ||
containerPort: 5672 | ||
protocol: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: rabbitmq | ||
spec: | ||
selector: | ||
app: rabbitmq | ||
ports: | ||
- port: 5672 | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
type: ClusterIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# to expose the port in order to connect with an IDE such as SQL MS, etc | ||
|
||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: sql-service | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: sql-data | ||
ports: | ||
- port: 1433 | ||
nodePort: 31433 | ||
name: sql-port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: sql-data | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: sql-data | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: sql-data | ||
spec: | ||
containers: | ||
- name: sql-data | ||
image: microsoft/mssql-server-linux:2017-latest | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: ACCEPT_EULA | ||
value: "Y" | ||
- name: MSSQL_PID | ||
value: Developer | ||
- name: MSSQL_SA_PASSWORD | ||
value: Pass@word | ||
ports: | ||
- name: http | ||
containerPort: 1433 | ||
protocol: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: sql-data | ||
spec: | ||
selector: | ||
app: sql-data | ||
ports: | ||
- port: 1433 | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
type: ClusterIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: trip | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: trip | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: trip | ||
spec: | ||
containers: | ||
- name: trip | ||
image: vany0114/duber.trip.api | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
memory: "128Mi" | ||
cpu: "200m" | ||
limits: | ||
memory: "256Mi" | ||
cpu: "600m" | ||
env: | ||
- name: ASPNETCORE_ENVIRONMENT | ||
value: "Development" | ||
- name: EventStoreConfiguration__ConnectionString | ||
value: "mongodb://nosql-data" | ||
- name: EventBusConnection | ||
value: "rabbitmq" | ||
- name: AzureServiceBusEnabled | ||
value: "False" | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: autoscaling/v1 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: trip | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: trip | ||
minReplicas: 5 | ||
maxReplicas: 10 | ||
targetCPUUtilizationPercentage: 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: trip-ingress | ||
spec: | ||
rules: | ||
- host: trip.local.com | ||
http: | ||
paths: | ||
- path: / | ||
backend: | ||
serviceName: trip | ||
servicePort: 80 |
Oops, something went wrong.