Created
July 18, 2019 19:02
-
-
Save rahulsahay19/7dfcaf4cb0108c1841eafc060c0a90ca to your computer and use it in GitHub Desktop.
api-deployment.yml
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: aksapi | |
namespace: aks-learning | |
labels: | |
run: aksapi | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
run: aksapi | |
template: | |
metadata: | |
labels: | |
run: aksapi | |
spec: | |
initContainers: | |
- name: init-myservice | |
image: rahulsahay19/sqlclient | |
imagePullPolicy: IfNotPresent | |
command: | |
- "sh" | |
- "-c" | |
- "/opt/mssql-tools/bin/sqlcmd -S db-deployment -U sa -P AKSLearn(!) -d master -i initialize-db.sql" | |
containers: | |
- name: aksapi | |
image: rahulsahay19/aksapi | |
imagePullPolicy: IfNotPresent | |
env: | |
- name: ASPNETCORE_URLS | |
value: http://0.0.0.0:8081 | |
- name: ConnectionStrings__DefaultConnection | |
value: "Data Source=db-deployment;Initial Catalog=AKSLearnDB;User Id=SA;Password=AKSLearn(!);MultipleActiveResultSets=True" | |
ports: | |
- containerPort: 8081 | |
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