Skip to content

Commit

Permalink
Add k8s deployment files
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Landeras committed Jun 16, 2019
1 parent c089f8b commit 94294e4
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 4 deletions.
65 changes: 65 additions & 0 deletions k8s/infra-deployment.yml
@@ -0,0 +1,65 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: sqlserver
spec:

template:
metadata:
labels:
app: sqlserver
spec:
containers:
- name: sqlserver
image: microsoft/mssql-server-linux
env:
- name : ACCEPT_EULA
value: "Y"
- name : SA_PASSWORD
value: "Password12!"
---

kind: Service
apiVersion: v1
metadata:
name: sqlserver
spec:
selector:
app: sqlserver
type: ClusterIP
ports:
-
port: 1433
targetPort: 1433

---

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redis
spec:

template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis
---
kind: Service
apiVersion: v1
metadata:
name: redis
spec:
selector:
app: redis
type: ClusterIP
ports:
-
port: 6379
targetPort: 6379


2 changes: 1 addition & 1 deletion deployment.yml → k8s/webapp-deployment.yml
Expand Up @@ -15,7 +15,7 @@ spec:
imagePullPolicy: Never
livenessProbe:
httpGet:
path: /self
path: /health
port: 80
scheme: HTTP
initialDelaySeconds: 10
Expand Down
Expand Up @@ -10,10 +10,10 @@ public static class IServiceCollectionExtensions
public static IServiceCollection AddCustomHealthChecks(this IServiceCollection services)
{
return services.AddHealthChecks()
.AddSqlServer("server=localhost;initial catalog=master;user id=sa;password=Password12!",
.AddSqlServer("server=sqlserver;initial catalog=master;user id=sa;password=Password12!",
tags: new[] { "dependencies" })

.AddRedis("server=localhost",
.AddRedis("redis",
tags: new[] { "dependencies" })

.AddCheck("self", () => HealthCheckResult.Healthy())
Expand Down
2 changes: 1 addition & 1 deletion src/DotNet2019.Host/Startup.cs
Expand Up @@ -36,7 +36,7 @@ public void Configure(IApplicationBuilder app)
{
endpoints.MapGet("/", async context =>
{
await context.Response.WriteAsync("Hello DotNet 2019!");
await context.Response.WriteAsync($"Hello DotNet 2019! from {System.Environment.MachineName}");
});
})
);
Expand Down

0 comments on commit 94294e4

Please sign in to comment.