Skip to content
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
4 changes: 2 additions & 2 deletions customer-master-data-management-mock/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ spec:
- "--verbose"
resources:
requests:
cpu: 100m
cpu: 500m
memory: "128Mi"
limits:
cpu: 100m
cpu: 500m
memory: "128Mi"
readinessProbe:
httpGet:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
},
"response": {
"status": 200,
"delayDistribution": {
"type": "lognormal",
"median": 80,
"sigma": 0.4
},
"bodyFileName":"responses/luke_response.json",
"headers":{
"Content-Type":"application/json"
Expand Down
3 changes: 2 additions & 1 deletion load-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

```bash
docker run --rm -i grafana/k6 run - <{PATH_TO_SCENARIO}/load-script.js
```
```
When using Github Action to run the load scenario, a timeout could happen when starting the pod ... This will end up in a failing Github Action run
30 changes: 14 additions & 16 deletions load-test/scenario-user-flow/load-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,31 @@ import http from 'k6/http';
import { Rate } from 'k6/metrics';
import { sleep } from 'k6';

const creditApplicationCreationRate = new Rate('failed credit application creation');
const creditApplicationAcceptanceRate = new Rate('failed credit application acceptance');
const creditApplicationCreationRate = new Rate('failed_credit_application_creation');
const creditApplicationAcceptanceRate = new Rate('failed_credit_application_acceptance');

export const options = {
vus: 10,
duration: '30s',
duration: '60s',
thresholds: {
'failed credit application creation': ['rate<0.1'],
'failed credit application acceptance': ['rate<0.1'],
'failed_credit_application_creation': ['rate<0.1'],
'failed_credit_application_acceptance': ['rate<0.1'],
'http_req_duration': ['p(95)<400'],
},
};

export default function () {
const creditApplicationCreation = http.post('http://creditapplication-service.lpt.svc.cluster.local:8080/api/credit-applications', {
"creditAmount":10000.00,
"firstName":"Harry",
"lastName":"Potter",
"zipCode":"12345",
"occupation":"IT",
"monthlyNetIncome":3000.00,
"monthlyExpenses":2500.00
const creditApplicationCreation = http.post('http://creditapplication-k8s-service.lpt.svc.cluster.local:8080/api/credit-applications', JSON.stringify({"creditAmount":10000.00,"firstName":"Jim","lastName":"Beam","zipCode":"12345","occupation":"IT","monthlyNetIncome":5000.00,"monthlyExpenses":2500.00}), {
headers: { 'Content-Type': 'application/json' },
});
creditApplicationCreationRate.add(creditApplicationCreation.status !== 201);
console.log(creditApplicationCreation.status)
console.log(creditApplicationCreation.body)
creditApplicationCreationRate.add(creditApplicationCreation.status !== 200);
const applicationId = creditApplicationCreation.body.id;
// after receiving the credit decision, the customer decides within 5 seconds to accept or decline the credit application
sleep(5);
const creditApplicationAcceptance = http.post(`http://creditapplication-service.lpt.svc.cluster.local:8080/api/credit-applications/${applicationId}`, {});
creditApplicationAcceptanceRate.add(creditApplicationAcceptance.status !== 200);
const creditApplicationAcceptance = http.post(`http://creditapplication-k8s-service.lpt.svc.cluster.local:8080/api/credit-applications/${applicationId}`, JSON.stringify({}), {
headers: { 'Content-Type': 'application/json' },
});
creditApplicationAcceptanceRate.add(creditApplicationAcceptance.status !== 202);
}
56 changes: 56 additions & 0 deletions monitoring/grafana/grafana.deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: grafana
name: grafana
spec:
selector:
matchLabels:
app: grafana
template:
metadata:
labels:
app: grafana
spec:
securityContext:
fsGroup: 472
supplementalGroups:
- 0
containers:
- name: grafana
image: grafana/grafana:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
name: http-grafana
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /robots.txt
port: 3000
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 2
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 3000
timeoutSeconds: 1
resources:
requests:
cpu: 250m
memory: 750Mi
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-pv
volumes:
- name: grafana-pv
emptyDir:
sizeLimit: 1Gi
13 changes: 13 additions & 0 deletions monitoring/grafana/grafana.service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: grafana
spec:
ports:
- port: 3000
protocol: TCP
targetPort: http-grafana
selector:
app: grafana
sessionAffinity: None
type: LoadBalancer
8 changes: 8 additions & 0 deletions monitoring/grafana/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: monitoring

resources:
- grafana.deployment.yaml
- grafana.service.yaml
4 changes: 4 additions & 0 deletions monitoring/monitoring.namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: monitoring
1 change: 1 addition & 0 deletions monitoring/prometheus-operator/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kubectl create -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/master/bundle.yaml
107 changes: 107 additions & 0 deletions monitoring/prometheus-operator/operator.clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: 0.77.2
name: prometheus-operator
rules:
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers
- alertmanagers/finalizers
- alertmanagers/status
- alertmanagerconfigs
- prometheuses
- prometheuses/finalizers
- prometheuses/status
- prometheusagents
- prometheusagents/finalizers
- prometheusagents/status
- thanosrulers
- thanosrulers/finalizers
- thanosrulers/status
- scrapeconfigs
- servicemonitors
- podmonitors
- probes
- prometheusrules
verbs:
- '*'
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- '*'
- apiGroups:
- ""
resources:
- configmaps
- secrets
verbs:
- '*'
- apiGroups:
- ""
resources:
- pods
verbs:
- list
- delete
- apiGroups:
- ""
resources:
- services
- services/finalizers
verbs:
- get
- create
- update
- delete
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- patch
- create
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- get
- list
- watch
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- get
- apiGroups:
- ""
resources:
- endpoints
verbs:
- get
- create
- update
- delete
16 changes: 16 additions & 0 deletions monitoring/prometheus-operator/operator.clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: 0.77.2
name: prometheus-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: prometheus-operator
subjects:
- kind: ServiceAccount
name: prometheus-operator
namespace: default
60 changes: 60 additions & 0 deletions monitoring/prometheus-operator/operator.deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: 0.77.2
name: prometheus-operator
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: prometheus-operator
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: prometheus-operator
app.kubernetes.io/version: 0.77.2
spec:
automountServiceAccountToken: true
containers:
- args:
- --kubelet-service=kube-system/kubelet
- --prometheus-config-reloader=europe-west1-docker.pkg.dev/vbdev-436712/lpt-quay-proxy/prometheus-operator/prometheus-config-reloader:v0.77.2
- --kubelet-endpoints=true
- --kubelet-endpointslice=false
env:
- name: GOGC
value: "30"
image: europe-west1-docker.pkg.dev/vbdev-436712/lpt-quay-proxy/prometheus-operator/prometheus-operator:v0.77.2
name: prometheus-operator
ports:
- containerPort: 8080
name: http
resources:
limits:
cpu: 200m
memory: 200Mi
requests:
cpu: 100m
memory: 100Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
nodeSelector:
kubernetes.io/os: linux
securityContext:
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: prometheus-operator
13 changes: 13 additions & 0 deletions monitoring/prometheus/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: monitoring

resources:
- prometheus.clusterrole.yaml
- prometheus.clusterrolebinding.yaml
- prometheus.serviceaccount.yaml
- prometheus.coreos.yaml
- prometheus.service.yaml
- prometheus.servicemonitor.yaml
- spring.servicemonitor.yaml
Loading