Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mohamedmejri patch 1 #2

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
5b8b81f
Create ansibleClients.inv
mohamedmejri Jan 21, 2022
23d125a
Create sqlserver-pv.yml
mohamedmejri Jan 21, 2022
048f76c
Update sqlserver-pv.yml
mohamedmejri Jan 21, 2022
0e4b47c
Update Kubernetes-PersistentStorage.yaml
mohamedmejri Jan 21, 2022
3b2a315
Create ansible-play-book.yaml
mohamedmejri Jan 21, 2022
006f63e
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
2f506c6
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
6f49b16
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
819997d
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
ca40eb9
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
40cba09
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
234e4a5
Update sqlserver-pv.yml
mohamedmejri Jan 21, 2022
ebce803
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
8f700c0
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
f55abac
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
1bc4a64
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
4c6979d
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
7bb4bd6
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
05492c1
Update Kubernetes_Deployment.yaml
mohamedmejri Jan 21, 2022
0a56dcb
Update Dockerfile
mohamedmejri Jan 21, 2022
6bf9867
Update Dockerfile
mohamedmejri Jan 21, 2022
ef0dbd0
Update Dockerfile
mohamedmejri Jan 21, 2022
8146788
Update Dockerfile
mohamedmejri Jan 21, 2022
8eb333d
Update Dockerfile
mohamedmejri Jan 21, 2022
553a926
Update Dockerfile
mohamedmejri Jan 21, 2022
86bd5b6
Update Dockerfile
mohamedmejri Jan 21, 2022
0c99134
Update Dockerfile
mohamedmejri Jan 21, 2022
46ececa
Update Dockerfile
mohamedmejri Jan 21, 2022
577bc22
Update Dockerfile
mohamedmejri Jan 21, 2022
b5eeddc
Update Dockerfile
mohamedmejri Jan 21, 2022
d2e96ad
Create Dockerfile
mohamedmejri Jan 21, 2022
2ae8f87
Update global.json
mohamedmejri Jan 21, 2022
8a41d57
Create ansible-play-book.yaml
mohamedmejri Jan 21, 2022
ba2ccfb
Create ansibleClients.inv
mohamedmejri Jan 21, 2022
3c9f3f9
Update ansible-play-book.yaml
mohamedmejri Jan 21, 2022
a365422
Update Kubernetes_Deployment_V3.yaml
mohamedmejri Jan 21, 2022
4b7af2a
Update global.json
mohamedmejri Jan 21, 2022
3ea17c5
Update Dockerfile
mohamedmejri Jan 21, 2022
80196f3
Update Dockerfile
mohamedmejri Jan 21, 2022
a04d66e
Update global.json
mohamedmejri Jan 21, 2022
3c905c7
Update global.json
mohamedmejri Jan 21, 2022
22263b8
Update Dockerfile
mohamedmejri Jan 21, 2022
ffa9dd3
Update Dockerfile
mohamedmejri Jan 21, 2022
9e71f47
Update global.json
mohamedmejri Jan 21, 2022
c5743f8
Update global.json
mohamedmejri Jan 21, 2022
1d2d999
Update Dockerfile
mohamedmejri Jan 21, 2022
7d217fb
Update SampleWebAppWithHealthchecks.csproj
mohamedmejri Jan 21, 2022
4ffedeb
Update global.json
mohamedmejri Jan 21, 2022
a90774e
Update Dockerfile
mohamedmejri Jan 21, 2022
52f6278
Update Dockerfile
mohamedmejri Jan 21, 2022
cb629bc
Update global.json
mohamedmejri Jan 21, 2022
8bb8673
Update SampleWebAppWithHealthchecks.csproj
mohamedmejri Jan 21, 2022
d6f2eea
Update Dockerfile
mohamedmejri Jan 21, 2022
78b9a8a
Update global.json
mohamedmejri Jan 21, 2022
372d78e
Update SampleWebAppWithHealthchecks.csproj
mohamedmejri Jan 21, 2022
e69183b
Update SampleWebAppWithHealthchecks.csproj
mohamedmejri Jan 21, 2022
d6040ce
Update global.json
mohamedmejri Jan 21, 2022
aded5d7
Update Dockerfile
mohamedmejri Jan 21, 2022
b96f7ae
Update global.json
mohamedmejri Jan 21, 2022
fee67e4
Update SampleWebAppWithHealthchecks.csproj
mohamedmejri Jan 21, 2022
d29ad3a
Update Dockerfile
mohamedmejri Jan 21, 2022
e19786f
Update SampleWebAppWithHealthchecks.csproj
mohamedmejri Jan 21, 2022
bb68bd7
Update SampleWebAppWithHealthchecks.csproj
mohamedmejri Jan 21, 2022
fde1412
Update SampleWebAppWithHealthchecks.csproj
mohamedmejri Jan 21, 2022
32c8e25
Update SampleWebAppWithHealthchecks.csproj
mohamedmejri Jan 21, 2022
407899b
Create test.txt
mohamedmejri May 5, 2023
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
8 changes: 4 additions & 4 deletions samplewebapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
FROM mcr.microsoft.com/dotnet/aspnet:2.1 AS base
WORKDIR /app
EXPOSE 80

ARG dbConnectionString
ENV DatabaseConnectionStringFromDockerEnvVariable $dbConnectionString

FROM microsoft/dotnet:2.1-sdk AS build
FROM mcr.microsoft.com/dotnet/sdk:2.1 AS build
WORKDIR /src
COPY ["SampleWebApp/SampleWebApp.csproj", "."]
COPY ["samplewebapp/SampleWebApp.csproj", "."]
RUN dotnet restore "SampleWebApp.csproj"
COPY . .
RUN dotnet build "SampleWebApp.csproj" -c Release -o /app
Expand All @@ -18,4 +18,4 @@ RUN dotnet publish "SampleWebApp.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "SampleWebApp.dll"]
ENTRYPOINT ["dotnet", "SampleWebApp.dll"]
4 changes: 2 additions & 2 deletions samplewebapp/Kubernetes/Kubernetes_Deployment_V3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: samplewebapp
image: YOUR_DOCKER_IMAGE
image: mohamedmejri/dotnet:0.0.1
readinessProbe:
httpGet:
path: /health/ready
Expand Down Expand Up @@ -51,4 +51,4 @@ spec:
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
schedulerName: default-scheduler
30 changes: 30 additions & 0 deletions samplewebapp/Kubernetes/ansible-play-book.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
- hosts: PROD
become: yes
tasks:
- name: send resources to k8s host
become_user: root
copy: src={{ item.src }} dest={{ item.dest }}
with_items:
- { src: '/var/lib/jenkins/workspace/P12-gitlab-jenkins-k8s-ingress-BE-ASP.NET-FE-Angular/samplewebapp/Kubernetes/', dest: '/home/ubuntu/jenkins/projet12/dotnet' }


- name: create Config Map
become: yes
become_user: ubuntu
shell: kubectl apply -f /home/ubuntu/jenkins/projet12/dotnet/Kubernetes_ConfigMap.yaml
register: kubernetes_join_command

- name: create Service
become: yes
become_user: ubuntu
shell: kubectl apply -f /home/ubuntu/jenkins/projet12/dotnet/Kubernetes_Service.yaml
register: kubernetes_join_command

- name: create Deployment
become: yes
become_user: ubuntu
shell: kubectl apply -f /home/ubuntu/jenkins/projet12/dotnet/Kubernetes_Deployment_V3.yaml
register: kubernetes_join_command


2 changes: 2 additions & 0 deletions samplewebapp/Kubernetes/ansibleClients.inv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[PROD]
3.22.159.47
4 changes: 2 additions & 2 deletions samplewebapp/SampleWebAppWithHealthchecks/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80

FROM microsoft/dotnet:2.2-sdk AS build
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
WORKDIR /src

COPY ["SampleWebAppWithHealthchecks.csproj", "SampleWebAppWithHealthchecks/"]
Expand Down
4 changes: 2 additions & 2 deletions samplewebapp/SampleWebAppWithHealthchecks/global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "2.2.102"
"version": "3.1"
}
}
}
2 changes: 1 addition & 1 deletion sqlserver/Kubernetes-PersistentStorage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ spec:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storage: 256Mi
18 changes: 12 additions & 6 deletions sqlserver/Kubernetes_Deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: mssql-sample-deployment
spec:
replicas: 1
selector:
matchLabels:
app: mssql-sample-deployment
tier: database
strategy:
type: Recreate
template:
metadata:
labels:
app: mssql-sample
app: mssql-sample-deployment
tier: database
spec:
terminationGracePeriodSeconds: 10
containers:
- name: mssql
image: microsoft/mssql-server-linux
- image: mcr.microsoft.com/mssql/server:2017-CU24-ubuntu-16.04
name: mssql
ports:
- containerPort: 1433
env:
Expand All @@ -29,4 +35,4 @@ spec:
volumes:
- name: mssql-persistent-storage
persistentVolumeClaim:
claimName: mssql-sample-data-claim
claimName: mssql-sample-data-claim
40 changes: 40 additions & 0 deletions sqlserver/ansible-play-book.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
- hosts: PROD
become: yes
tasks:
- name: send resources to k8s host
become_user: root
copy: src={{ item.src }} dest={{ item.dest }}
with_items:
- { src: '/var/lib/jenkins/workspace/P12-gitlab-jenkins-k8s-ingress-BE-ASP.NET-FE-Angular/sqlserver', dest: '/home/ubuntu/jenkins/projet12' }

- name: create Persistance Volume
become: yes
become_user: ubuntu
shell: kubectl apply -f /home/ubuntu/jenkins/projet12/sqlserver/sqlserver-pv.yml
register: kubernetes_join_command


- name: create Persistance Volume Claim
become: yes
become_user: ubuntu
shell: kubectl apply -f /home/ubuntu/jenkins/projet12/sqlserver/Kubernetes-PersistentStorage.yaml
register: kubernetes_join_command

- name: Create a Kubernetes Secret
become: yes
become_user: ubuntu
shell: kubectl apply -f /home/ubuntu/jenkins/projet12/sqlserver/Kubernetes_Secret.yaml
register: kubernetes_join_command

- name: Create a Kubernetes Service
become: yes
become_user: ubuntu
shell: kubectl apply -f /home/ubuntu/jenkins/projet12/sqlserver/Kubernetes_Service.yaml
register: kubernetes_join_command

- name: Create a Deployment
become: yes
become_user: ubuntu
shell: kubectl apply -f /home/ubuntu/jenkins/projet12/sqlserver/Kubernetes_Deployment.yaml
register: kubernetes_join_command
2 changes: 2 additions & 0 deletions sqlserver/ansibleClients.inv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[PROD]
3.22.159.47
11 changes: 11 additions & 0 deletions sqlserver/sqlserver-pv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: mssql-sample-data
spec:
capacity:
storage: 256Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/home/ubuntu/jenkins/sqlserver"
1 change: 1 addition & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
for test