Skip to content

Instantly share code, notes, and snippets.

Helm Basic


Helm là công cụ cho phép triển khai, quản lý các ứng dụng trong Kubernetes dễ dàng hơn. Helm sử dụng các chart (là tập hợp các file yaml (manifest)) để triển khai ứng dụng. Helm cung cấp các tính năng:

  • Tìm kiếm và sử dụng các ứng dụng được cấu hình từ trước trên helm (helm-chart), ưu điểm là có thể sử dụng luôn mà chỉ cần thay đổi rất ít thông số, nhưng nhược điểm là kiến trúc được định nghĩa từ trước, thay đổi cần thêm thời gian tìm hiểu
  • Tự mình cũng có thể định nghĩa một chart cho ứng dụng muốn, giúp cho các lần cài đặt sau đơn giản hơn nhiều.
  • Sửa đổi các file manifest đơn giản bởi Helm hỗ trợ file cấu hình tập trung (values.yaml) và cho phép người dùng định nghĩa thêm (predefined-values và Partials)

1. Keywords

Access dashboard in Kubernetes


In this guide, we will find out how to create a new user using Service Account mechanism of Kubernetes, grant this user admin permissions and log in to Dashboard using bearer token tied to this user.

Copy provided snippets to some xxx.yaml file and use kubectl apply -f xxx.yaml to create them.

Create admin

Create Service Account with name admin-user in namespace kube-system first.

#from scapy.all import *
import subprocess
from datetime import datetime
import time
import sys
import csv
# python <filename.py> interface conntrack_threshold &
def dump(interface, duration=60):
@hieunt79
hieunt79 / install_docs.txt
Last active March 10, 2020 12:22
designate install ...
apt-get install -y software-properties-common
add-apt-repository -y cloud-archive:queens
# apt update && apt dist-upgrade
# for openstack before stein
apt install python-openstackclient
@hieunt79
hieunt79 / curl.md
Created November 2, 2019 07:38 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

2. System Performance: Methodologies

2.1 Terminology

  • IOPS: Input/output operations per second is a measure of the rate of data transfer operations. For disk I/O, IOPS refers to reads and writes per second.
  • Throughput: The rate of work performed. Especially in communications, the term is used to refer to the data rate (bytes per second or bits per second). In some contexts (e.g., databases) throughput can refer to the operation rate (operations per second or transactions per second).
  • Response time: The time for an operation to complete. This includes any time spent waiting and time spent being serviced (service time), including the time to transfer the result.
  • latency: A measure of time an operation waiting to be serviced. In some contexts, it can refers to the entire time for an operation, equivalent to response time.
  • Utilization: với các resource cung cấp theo kiểu request, đây là cách đo lường cho mức độ resource đc sử dụng (how busy a resource is), dựa trên thời gian sử
@hieunt79
hieunt79 / ping_all.sh
Last active April 24, 2020 08:15
ping with timestamp
#!/bin/bash
for ip in {5..12}
do
ping 12.12.12.$ip| while read line; do echo `date` - $line; done >> node.$ip &
done
@hieunt79
hieunt79 / pageload.sh
Last active November 10, 2020 07:03
Jmeter for delay time
#!/bin/bash
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
DELAY_FOLDER="/delay"
JMETER_BIN_DIR="$DELAY_FOLDER/jmeter/bin"
current=`date "+%s"`
# measure origin test
$JMETER_BIN_DIR/jmeter --nongui --testfile $DELAY_FOLDER/test-plans/origin/test.jmx --logfile $DELAY_FOLDER/test-results/origin/$current-sample.csv > /dev/null &
@hieunt79
hieunt79 / 01-get-healthcheck.sh
Last active November 26, 2020 06:45
Linux scripts
#!/bin/bash
cd /tmp
ip_list="$@"
while true
clear
tput cup 0 0
do
for ip in $ip_list
@hieunt79
hieunt79 / count_request.sh
Created July 31, 2020 03:31
Count rp10m, rph of log file
#!/bin/bash
LOG_FILE=$1
#for hour in 00 01 02 03
#do
# pattern=" $hour"
# rph=`egrep " $hour:" $LOG_FILE | wc -l`
# echo $hour : $rph
#done