Skip to content

Instantly share code, notes, and snippets.

@NileshGule
Created November 7, 2018 11:21
Show Gist options
  • Save NileshGule/051b4dfe9d7f951d58d8a561fb50eef0 to your computer and use it in GitHub Desktop.
Save NileshGule/051b4dfe9d7f951d58d8a561fb50eef0 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: techtalksapi
namespace: aks-part4
labels:
run: techtalksapi
spec:
replicas: 1
selector:
matchLabels:
run: techtalksapi
template:
metadata:
labels:
run: techtalksapi
spec:
initContainers:
- name: init-myservice
image: nileshgule/sqlclient
imagePullPolicy: IfNotPresent
env:
- name: SA_PASSWORD
valueFrom:
secretKeyRef:
name: sqlsecret
key: sapassword
command:
- "sh"
- "-c"
- "/opt/mssql-tools/bin/sqlcmd -S db-deployment -U sa -P $(SA_PASSWORD) -d master -i initialize-database.sql"
containers:
- name: techtalksapi
image: nileshgule/techtalksapi
imagePullPolicy: IfNotPresent
env:
- name: ASPNETCORE_URLS
value: http://0.0.0.0:8080
- name: SA_PASSWORD
valueFrom:
secretKeyRef:
name: sqlsecret
key: sapassword
- name: ConnectionStrings__DefaultConnection
value: "Data Source=db-deployment;Initial Catalog=TechTalksDB;User Id=SA;Password=$(SA_PASSWORD);MultipleActiveResultSets=True"
ports:
- containerPort: 8080
protocol: TCP
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment