Skip to content

Instantly share code, notes, and snippets.

## GitLab CE image
## ref: https://hub.docker.com/r/gitlab/gitlab-ce/tags/
##
image: gitlab/gitlab-ce:9.4.1-ce.0
## Specify a imagePullPolicy
## 'Always' if imageTag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
# imagePullPolicy:

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

## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
global:
postgresql: {}
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName
# DB information
DB_NAME=test
USER_DB=test
PASSWD_DB=secret
# package for nginx
apt update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential \
libpcre3 libpcre3-dev libssl-dev \

UPDATE users SET channel_name = 'admin channel', channel_title = 'Welcome to admin channel!', display_name = 'admin', WHERE email='admin@gg.com';

ffmpeg -re -i video.mp4 -vcodec libx264 -vprofile baseline -g 30 -acodec aac -strict -2 -f flv rtmp://localhost/live/stream1

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):
import csv
import json
with open("raw_data.json", mode='r') as read_json:
data = json.load(read_json)
result = []
print()
index = 0
@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.