This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step by step how to pull a private DockerHub hosted image in a Kubernetes YML. | |
export DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/ | |
export DOCKER_USER=Type your dockerhub username, same as when you `docker login` | |
export DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login` | |
export DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login` | |
kubectl create secret docker-registry myregistrykey \ | |
--docker-server=$DOCKER_REGISTRY_SERVER \ | |
--docker-username=$DOCKER_USER \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1="\[\e[33m\]\u\[\e[m\]@\[\e[31m\]\h\[\e[m\][\[\e[36m\]\w\[\e[m\]]:/ " | |
alias grep='grep -n --color' | |
============================================================================================================ | |
put after alias | |
============================================================================================================ | |
# get current branch in git repo | |
function parse_git_branch() { | |
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
if [ ! "${BRANCH}" == "" ] | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
haproxy_exporter --haproxy.scrape-uri="http://user:password@localhost:8000/haproxy_stats;csv" & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d --name nginx -p 80:80 nginx --запуск nginx | |
docker run -dit --name httpd -p 80:80 httpd --запуска apache2 | |
docker commit a092db630f2c - сохранение образа ОС | |
docker pull ubuntu:18.04 - закачка Ubuntu 18.04 | |
docker ps - список запущенных контейнеров | |
docker run -ti ubuntu:18.04 - зайти в запущенный контейнер | |
docker run -d -P --name web --link php:latest httpd:latest | |
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer | |
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer --admin-password '$2y$05$6jklXGSkfeCBpDyEhuExSOOYUHTj6uIEpP9Reatm4ztiRmRPKZ3TC' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helm create mychart - создание шаблона mychart | |
helm del --purge mychart - удаление чарта | |
helm install --name grafana-chart /home/ubuntu/grafana-chart/ - установка чарта из диска | |
helm lint /home/ubuntu/mychart - проверка чарта на ошибки |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /etc/origin/node/certificates -name '*.pem' -exec openssl x509 -text -noout -in {} \; | grep -A2 Validity - проверка сертификатов | |
find /space/nfs-ocp-test/fserver-files/secure -type f -mtime +30 -exec ls -l >> /home/ls.log {} \; - запись списка файлов старше 30 дней в файл ls.log | |
ps -eo pid,ppid,cmd,%mem,%cpu --=-%mem | head - показать топ процессы по цпу и озу | |
ps -eo pcpu,pid,user,args | sort -k 1 -r | head - показать топ процессы по цпу | |
find . -size 0 -type f -ls - показать файлы с размером 0 байт | |
for i in {1..10000}; do touch "myfile$i"; done - loop command 1000 times | |
while true; do curl http://test.kz; sleep 1; done | |
curl -s -q -o /dev/null -w "\nConnect: %{time_connect}\nTTFB: %{time_starttransfer}\nTotal time: %{time_total} \n" https://yourweb.kz - показать ttfb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oc import-image python:3.7-alpine --from=python:3.7-alpine --confirm - импорт образа в локальный image stream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
========================================gluster-FS | |
apiVersion: v1 | |
kind: Endpoints | |
metadata: | |
annotations: | |
name: glusterfs-cluster | |
namespace: test | |
subsets: | |
- addresses: | |
- ip: 10.204.11.21 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
livenessProbe: | |
failureThreshold: 10 | |
initialDelaySeconds: 30 | |
periodSeconds: 30 | |
successThreshold: 1 | |
tcpSocket: | |
port: 8080 | |
timeoutSeconds: 3 | |
name: default | |
readinessProbe: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sestatus -b - показать контексты | |
setsebool -P haproxy_connect_any=1 | |
setsebool -P httpd_can_network_connect 1 - enable NGINX | |
sudo cat /var/log/audit/audit.log | grep nginx | grep denied - troubleshooting log SELinux |