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

thuytt submit final #145

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions Practice-6/TranThuThuy/Custom-metrics/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: rps-sample
spec:
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Deployment
name: rps-sample
minReplicas: 2
maxReplicas: 10
metrics:
- type: Pods
pods:
metricName: rps
targetAverageValue: 10
43 changes: 43 additions & 0 deletions Practice-6/TranThuThuy/Custom-metrics/rps-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: rps-sample
spec:
selector:
matchLabels:
app: rps-sample
template:
metadata:
labels:
app: rps-sample
spec:
containers:
- name: rps-sample
image: jsturtevant/metric-rps-example
env:
- name: INSTRUMENTATION_KEY
valueFrom:
secretKeyRef:
name: appinsightskey
key: instrumentation-key
---
kind: Service
apiVersion: v1
metadata:
name: rps-sample
spec:
selector:
app: rps-sample
ports:
- port: 80
targetPort: 8080
type: LoadBalancer

---
apiVersion: azure.com/v1alpha2
kind: CustomMetric
metadata:
name: rps
spec:
metric:
metricName: performanceCounters/requestsPerSecond
3 changes: 3 additions & 0 deletions Practice-6/TranThuThuy/HPA/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM php:5-apache
COPY index.php /var/www/html/index.php
RUN chmod a+rx index.php
7 changes: 7 additions & 0 deletions Practice-6/TranThuThuy/HPA/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
$x = 0.0001;
for ($i = 0; $i <= 1000000; $i++) {
$x += sqrt($x);
}
echo "OK!";
?>
96 changes: 96 additions & 0 deletions Practice-6/TranThuThuy/HPA/php-apache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
apiVersion: apps/v1

kind: Deployment

metadata:

name: php-apache

spec:

selector:

matchLabels:

run: php-apache

replicas: 1

template:

metadata:

labels:

run: php-apache

spec:

containers:

- name: php-apache

image: k8s.gcr.io/hpa-example

ports:

- containerPort: 80

resources:

limits:

cpu: 500m

requests:

cpu: 200m

---

apiVersion: v1

kind: Service

metadata:

name: php-apache

labels:

run: php-apache

spec:

ports:

- port: 80

selector:

run: php-apache

---
apiVersion: autoscaling/v1

kind: HorizontalPodAutoscaler

metadata:

name: php-apache

spec:

scaleTargetRef:

apiVersion: apps/v1

kind: Deployment

name: php-apache

minReplicas: 1

maxReplicas: 10

targetCPUUtilizationPercentage: 50
Binary file added Practice-6/TranThuThuy/images/afterloadd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/archi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/gethpa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/horizontal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/hpa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/hpa2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/k8s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/kgetall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/kgetpod2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/load.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/load2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/load3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/metric.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/metrics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/php-apache-hpa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/pod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/rps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/service.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/svc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practice-6/TranThuThuy/images/vertical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading