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

Update app.py #183

Open
wants to merge 81 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
3b16da1
Update app.py
manojkumarkudla Feb 9, 2023
009666c
Update pythonapp.yml
manojkumarkudla Feb 9, 2023
2ee2802
Update pythonapp.yml
manojkumarkudla Feb 9, 2023
2acf022
Update app.py
manojkumarkudla Feb 9, 2023
79ba263
Update pythonapp.yml
manojkumarkudla Feb 9, 2023
71c5d53
Update pythonapp.yml
manojkumarkudla Feb 9, 2023
aea5c1a
Update Dockerfile
manojkumarkudla Feb 9, 2023
5fe1cc1
Create deployment.yml
manojkumarkudla Feb 13, 2023
3cf6bf6
Create hpa.yml
manojkumarkudla Feb 13, 2023
e1e5a0e
Create kustomization.yml
manojkumarkudla Feb 13, 2023
1f2675e
Create service.yml
manojkumarkudla Feb 13, 2023
89fdfaa
Create kustomization.yml
manojkumarkudla Feb 13, 2023
e839c52
Create kustomization.yml
manojkumarkudla Feb 13, 2023
62a2607
Create replicas-patch.yml
manojkumarkudla Feb 13, 2023
0312a0e
Update lasample.yaml
manojkumarkudla Feb 13, 2023
535fa02
Update deployment.yml
manojkumarkudla Feb 13, 2023
2b53e2b
Update lasample.yaml
manojkumarkudla Feb 13, 2023
e3ca0d7
Update lasample.yaml
manojkumarkudla Feb 13, 2023
6a61215
Create preprod.yml
manojkumarkudla Feb 13, 2023
4f37e17
Update app.py
manojkumarkudla Feb 13, 2023
17a5d1a
Update Commands.md
manojkumarkudla Feb 13, 2023
734ee97
Update nginx.yaml
manojkumarkudla Feb 13, 2023
6935338
Create preprod.yml
manojkumarkudla Feb 14, 2023
dc8ca91
Delete nam-prepod directory
manojkumarkudla Feb 14, 2023
e208064
Create namespace.yml
manojkumarkudla Feb 15, 2023
3bd42c9
Create namespace.yml
manojkumarkudla Feb 15, 2023
89ae17d
Update replicas-patch.yml
manojkumarkudla Feb 15, 2023
22374d7
Update service.yml
manojkumarkudla Feb 15, 2023
5f689af
Update deployment.yml
manojkumarkudla Feb 15, 2023
f478691
Update app.py
manojkumarkudla Feb 15, 2023
79fed63
Update service.yml
manojkumarkudla Feb 16, 2023
31807f5
Update kustomization.yml
manojkumarkudla Feb 16, 2023
f6f07ec
Update kustomization.yml
manojkumarkudla Feb 16, 2023
8036b08
Update deployment.yml
manojkumarkudla Feb 16, 2023
00d155f
Create namespace.yml
manojkumarkudla Feb 16, 2023
6128746
Update lasample.yaml
manojkumarkudla Mar 23, 2023
4310f31
Update app.py
manojkumarkudla Mar 23, 2023
fb0314c
Update app.py
manojkumarkudla Mar 23, 2023
e89793c
Create deployment.yml
manojkumarkudla Mar 27, 2023
942f8f1
Create deployment.yml
manojkumarkudla Mar 27, 2023
f9f1fc5
Delete preprod.yml
manojkumarkudla Mar 27, 2023
245e1a5
Update deployment.yml
manojkumarkudla Mar 27, 2023
3c6522b
Update deployment.yml
manojkumarkudla Mar 27, 2023
5de7cad
Update deployment.yml
manojkumarkudla Mar 27, 2023
6024046
Update deployment.yml
manojkumarkudla Mar 27, 2023
1babbe3
Update deployment.yml
manojkumarkudla Mar 27, 2023
33ee85e
Update deployment.yml
manojkumarkudla Mar 27, 2023
131b48c
Update deployment.yml
manojkumarkudla Apr 3, 2023
0b77aca
Update deployment.yml
manojkumarkudla Apr 3, 2023
995d4c9
Update hpa.yml
manojkumarkudla Apr 3, 2023
f688fa0
Update service.yml
manojkumarkudla Apr 3, 2023
f442915
Update replicas-patch.yml
manojkumarkudla Apr 3, 2023
87738b4
Update deployment.yml
manojkumarkudla Apr 3, 2023
c5add87
Update hpa.yml
manojkumarkudla Apr 3, 2023
e513b5c
Update service.yml
manojkumarkudla Apr 3, 2023
e10a801
Update service.yml
manojkumarkudla Apr 3, 2023
4b76e67
Update service.yml
manojkumarkudla Apr 3, 2023
ce0328f
Update kustomization.yml
manojkumarkudla Apr 3, 2023
3fc79c2
Update deployment.yml
manojkumarkudla Apr 5, 2023
0d60721
Update kustomization.yml
manojkumarkudla Apr 5, 2023
09275e2
Update service.yml
manojkumarkudla Apr 5, 2023
24f581c
Delete namespace.yml
manojkumarkudla Apr 5, 2023
453f12c
Update kustomization.yml
manojkumarkudla Apr 5, 2023
06f356b
Update deployment.yml
manojkumarkudla Apr 5, 2023
cdc8b84
Delete namespace.yml
manojkumarkudla Apr 5, 2023
e655eca
Delete replicas-patch.yml
manojkumarkudla Apr 5, 2023
24c2792
Delete namespace.yml
manojkumarkudla Apr 5, 2023
c4827de
Update kustomization.yml
manojkumarkudla Apr 5, 2023
264abf9
Create replicas-patch.yml
manojkumarkudla Apr 5, 2023
8fe7335
Update hpa.yml
manojkumarkudla Apr 5, 2023
85255a2
Update kustomization.yml
manojkumarkudla Apr 5, 2023
3d697df
Create namespace.yml
manojkumarkudla Apr 5, 2023
63c2bde
Update lasample.yaml
manojkumarkudla Apr 5, 2023
ed65856
Update namespace.yml
manojkumarkudla Apr 5, 2023
9d022b5
Update kustomization.yml
manojkumarkudla Apr 5, 2023
a496fd0
Create .flux.yml
manojkumarkudla Apr 5, 2023
463da23
Create values-flux-preprod.yaml
manojkumarkudla Apr 5, 2023
624295a
Create values-flux-prod.yaml
manojkumarkudla Apr 5, 2023
cad9407
Create flux-patch.yaml
manojkumarkudla Apr 5, 2023
abee953
Create flux-patch.yaml
manojkumarkudla Apr 5, 2023
a8bfaeb
Delete namespace.yml
manojkumarkudla Apr 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
5 changes: 5 additions & 0 deletions .flux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1
patchUpdated:
generators:
- command: kubectl kustomize .
patchFile: flux-patch.yaml
6 changes: 3 additions & 3 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
- name: Build & Push Image
run: |
cd ./python
echo "${{ secrets.DOCKERPW }}" | docker login -u "[your dockerhub login here]" --password-stdin
docker image build -t [your dockerhub username here]/gitops:hellov1.0 .
docker push [your docker hub username here]/gitops:hellov1.0
echo "${{ secrets.DOCKERPW }}" | docker login -u manojkumarkudla --password-stdin
docker image build -t manojkumarkudla/gitops:hellov1.3 .
docker push manojkumarkudla/gitops:hellov1.3
24 changes: 24 additions & 0 deletions base/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: helloworld
labels:
app: helloworld
spec:
revisionHistoryLimit: 2
selector:
matchLabels:
app: helloworld
template:
metadata:
labels:
app: helloworld
spec:
containers:
- name: helloworld
image: manojkumarkudla/gitops:nginx1.0
imagePullPolicy: Always
ports:
- name: web
containerPort: 80
16 changes: 16 additions & 0 deletions base/hpa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: helloworld
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: helloworld
minReplicas: 1
maxReplicas: 2
metrics:
- type: Resource
resource:
name: cpu
targetAverageUtilization: 60
7 changes: 7 additions & 0 deletions base/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yml
- deployment.yml
- service.yml
- hpa.yml
11 changes: 11 additions & 0 deletions base/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
apiVersion: v1
kind: Service
metadata:
name: helloworld
spec:
ports:
- port: 80
selector:
app: helloworld
type: NodePort
1 change: 1 addition & 0 deletions docs/Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ $ kubectl create namespace flux

The following is the fluxctl install command used to deploy the flux pods to a cluster within the flux namespace. This is the example used in the "Installing with GitHub Lab".

export GHUSER=your github username
```
$ fluxctl install \
--git-user=${GHUSER} \
Expand Down
4 changes: 2 additions & 2 deletions namespaces/lasample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v1
kind: Namespace
metadata:
labels:
name: lasample
name: lasample
name: preprod
name: preprod
17 changes: 17 additions & 0 deletions preprod/flux-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
flux.weave.works/automated: "true"
flux.weave.works/tag.helloworld: semver:~1
name: preprod-helloworld
namespace: preprod
spec:
template:
spec:
$setElementOrder/containers:
- name: helloworld
containers:
- image: particule/helloworld:1.1
name: helloworld
6 changes: 6 additions & 0 deletions preprod/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../base/
namespace: preprod
namePrefix: preprod-
10 changes: 10 additions & 0 deletions prod/flux-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
flux.weave.works/locked: "true"
flux.weave.works/locked_msg: Lock deployment in production
flux.weave.works/locked_user: Particule
name: prod-helloworld
namespace: prod
8 changes: 8 additions & 0 deletions prod/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../base/
namespace: prod
namePrefix: prod-
patchesStrategicMerge:
- replicas-patch.yml
8 changes: 8 additions & 0 deletions prod/replicas-patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: helloworld
spec:
minReplicas: 2
maxReplicas: 4
19 changes: 19 additions & 0 deletions production/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello
namespace: lasample
labels:
app: hello
spec:
selector:
matchLabels:
app: hello
template:
metadata:
labels:
app: hello
spec:
containers:
- name: hello
image: manojkumarkudla/gitops:hellov1.1
2 changes: 1 addition & 1 deletion python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM python:3-alpine
COPY . /python
WORKDIR /python
RUN pip install -r requirements.txt
CMD python /python/app.py
CMD ["python", "/python/app.py", "ENV PIP_ROOT_USER_ACTION=ignore"]
2 changes: 1 addition & 1 deletion python/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@app.route("/")
def hello():
return "Hello World!"
return "Hello World!1!"

if __name__ == "__main__":
app.run(host='0.0.0.0', port=8000)
19 changes: 19 additions & 0 deletions qa/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello
namespace: lasample
labels:
app: hello
spec:
selector:
matchLabels:
app: hello
template:
metadata:
labels:
app: hello
spec:
containers:
- name: hello
image: manojkumarkudla/gitops:hellov1.2
12 changes: 12 additions & 0 deletions values-flux-preprod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
git:
pollInterval: 1m
url: [email protected]:manojkumarkudla/content-gitops.git
branch: master
path: preprod
syncGarbageCollection:
enabled: true
manifestGeneration: true
additionalArgs:
- --git-sync-tag=flux-sync-preprod
allowedNamespaces:
- preprod
8 changes: 8 additions & 0 deletions values-flux-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
git:
pollInterval: 1m
url: [email protected]:manojkumarkudla/content-gitops.git
branch: master
path: prod
syncGarbageCollection:
enabled: true
manifestGeneration: true
2 changes: 1 addition & 1 deletion workloads/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
app: nginx
spec:
replicas: 2
#replicas: 2
selector:
matchLabels:
app: nginx
Expand Down