Closed radchenkoam closed 3 years ago
$ mkdir yandex-tank
$ touch load.yaml
$ touch ammo_local.txt
load.yaml
phantom: address: 35.228.224.10:5000 instances: 50 load_profile: load_type: rps schedule: const(5000, 1m) ammofile: /var/loadtest/ammo_local.txt ammo_type: uripost console: enabled: true telegraf: enabled: false
ammo_local.txt
[Host: 35.228.224.10:5000] [Connection: keep-alive] [User-Agent: Tank] [Content-Type: application/json] 0 /person
docker run -v $(pwd):/var/loadtest -v $HOME/.ssh:/root/.ssh -it direvius/yandex-tank
как разместить приложение в кубере
Dockerfile
FROM node:14
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 5000 CMD [ "node", "index.js" ]
.dockerignore
node_modules npm-debug.log .gitignore
$ sudo docker build -t radchenkoam/node-person-app .
$ sudo docker tag radchenkoam/node-person-app radchenkoam/node-person-app:latest
$ sudo docker push radchenkoam/node-person-app:latest
kube_person-app.yaml
apiVersion: apps/v1 kind: Deployment metadata: name: node-person-app spec: selector: matchLabels: app: node-person-app replicas: 2 template: metadata: labels: app: node-person-app spec: containers: - name: node-person-app image: radchenkoam/node-person-app:latest ports: - containerPort: 5000 protocol: TCP
$ kubectl apply -f ./kube_person-app.yaml
если надо - можно создать LoadBalancer
kube_loadbalancer.yaml
apiVersion: v1 kind: Service metadata: name: node-person-app-loadbalancer spec: type: LoadBalancer selector: app: node-person-app ports: - protocol: TCP port: 5000 targetPort: 5000 name: http
отправить в кубер
$ kubectl apply -f ./kube_person-app.yaml
yandex-tank
ssh
docker