-
-
Save valmac/d8f84b8e9def4f24c1f342001a2e15fb to your computer and use it in GitHub Desktop.
Revisions
-
Nurlan199206 revised this gist
Nov 29, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,8 @@ kubectl get pods && kubectl get services --all-namespaces kubectl get nodes - список нодов kubectl taint nodes --all node-role.kubernetes.io/master- - запуска подов на мастере. kubectl get pod redis --watch kubectl delete service,deployment nginx - удалить сервис и поды nginx -
Nurlan199206 revised this gist
Nov 6, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -133,6 +133,7 @@ oc adm policy add-role-to-user admin nurlan -n load-test - добавить ро oc get rolebinding.rbac -n openshift-monitoring oc describe rolebinding.rbac -n NAMESPACE oc get clusterrole - список ролей oc get clusterrolebind - список clusterrolebinding oc create clusterrolebinding grafana1 --clusterrole=cluster-monitoring-operator --user=grafana1 - создание clusterrolebinding с названием grafana1 для юзера grafana1 oc get clusterrolebinding grafana1 - показать role binding для пользователя grafana1 -
Nurlan199206 revised this gist
Nov 6, 2019 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -130,11 +130,10 @@ kubectl -n kube-system edit cm kubeadm-config -oyaml - Редактируем Co kubectl run -i --tty --rm debug --image=python:3.8.0b1-slim --restart=Never -- sh =================================ROLES Troubleshooting============================================= oc adm policy add-role-to-user admin nurlan -n load-test - добавить роль админа на namespace load-test для юзера nurlan oc get rolebinding.rbac -n openshift-monitoring oc describe rolebinding.rbac -n NAMESPACE oc get clusterrole - список ролей oc create clusterrolebinding grafana1 --clusterrole=cluster-monitoring-operator --user=grafana1 - создание clusterrolebinding с названием grafana1 для юзера grafana1 oc get clusterrolebinding grafana1 - показать role binding для пользователя grafana1 -
Nurlan199206 revised this gist
Nov 6, 2019 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -90,6 +90,8 @@ kubectl delete clusterrolebinding cluster-system-anonymous - удаление р kubectk get clusterrole - вывод списка ролей kubectl get clusterrole system:NAME -o yaml oc create clusterrolebinding grafana1 --clusterrole=cluster-monitoring-operator --user=grafana1 ====================volumes====================================== kubectl get pv NAME - вывод списка томов PersistantVolume @@ -132,6 +134,7 @@ oc get clusterrole - список ролей oc get rolebinding.rbac -n openshift-monitoring oc describe rolebinding.rbac -n NAMESPACE oc get clusterrolebinding grafana1 - показать role binding для пользователя grafana1 create clusterrolebinding grafana1 --clusterrole=cluster-monitoring-operator --user=grafana1 - создание clusterrolebinding с названием grafana1 для юзера grafana1 -
Nurlan199206 revised this gist
Nov 6, 2019 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -126,6 +126,12 @@ kubectl -n kube-system get cm kubeadm-config -oyaml - Просмотр ControlPl kubectl -n kube-system edit cm kubeadm-config -oyaml - Редактируем ControlPlaneEndpoint для изменения IP для kube-api ===================================INTERACTIVE CONTAINER=========================================== kubectl run -i --tty --rm debug --image=python:3.8.0b1-slim --restart=Never -- sh =================================ROLES Troubleshooting============================================= oc adm policy add-role-to-user admin nurlan -n load-test - добавить роль админа на namespace load-test для юзера nurlan oc get clusterrole - список ролей oc get rolebinding.rbac -n openshift-monitoring oc describe rolebinding.rbac -n NAMESPACE oc get clusterrolebinding grafana1 - показать role binding для пользователя grafana1 -
Nurlan199206 revised this gist
Oct 25, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,8 @@ kubectl delete service,deployment nginx - удалить сервис и под kubectl get pod NAME --output=yaml - показать значение пода kubectl get deploy elasticsearch -o yaml - показать deployment в yaml kubectl describe pod NAME --namespace=NAME - показать значения пода kubectl delete pod NAME --grace-period=0 --force -
Nurlan199206 revised this gist
Oct 7, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -16,6 +16,8 @@ kubectl delete pod NAME --grace-period=0 --force kubectl logs NAME - посмотреть логи контейнера kubectl logs -f NAME - посмотреть логи контейнера в интерактивном режиме kubectl exec -ti NAME bash - интерактивный режим bash kubectl expose deployment nginx --type=NodePort --port=80 - выставить сервис наружу -
Nurlan199206 revised this gist
Jul 6, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -120,6 +120,8 @@ kubectl expose deployment hello-world --type=LoadBalancer --name=my-service ====================================kube-adm====================== kubectl -n kube-system get cm kubeadm-config -oyaml - Просмотр ControlPlaneEndpoint для изменения IP для kube-api kubectl -n kube-system edit cm kubeadm-config -oyaml - Редактируем ControlPlaneEndpoint для изменения IP для kube-api ===================================INTERACTIVE CONTAINER=========================================== kubectl run -i --tty --rm debug --image=python:3.8.0b1-slim --restart=Never -- sh -
Nurlan199206 revised this gist
Jun 25, 2019 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -117,6 +117,9 @@ kubectl expose deployment hello-world --type=LoadBalancer --name=my-service - с kubectl run hello-world --replicas=5 --labels="run=load-balancer-example" --image=gcr.io/google-samples/node-hello:1.0 --port=8080 kubectl expose deployment hello-world --type=LoadBalancer --name=my-service ====================================kube-adm====================== kubectl -n kube-system get cm kubeadm-config -oyaml - Просмотр ControlPlaneEndpoint для изменения IP для kube-api kubectl -n kube-system edit cm kubeadm-config -oyaml - Редактируем ControlPlaneEndpoint для изменения IP для kube-api -
Nurlan199206 revised this gist
Jun 11, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -105,6 +105,8 @@ kubectl get secrets - вывод списка для secrets kubectl describe secrets/db-user-pass kubectl get secret db-user-pass -o yaml - вывод логина и пароля secret db-user-pass kubectl -n kube-system describe secret deployment-controller-token-9pn6n - получить token для дашборда =====================network===================================== kubectl expose deployment hello-world --type=LoadBalancer --name=my-service - создание Service для Deployment hello-world с типом лоадбалансера. -
Nurlan199206 revised this gist
May 29, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -48,7 +48,7 @@ kubectl describe deployment - описать развертывание kubectl rollout history deployment/nginx - вывод истории развертывания kubectl rollout history deployment/nginx --revision=1 - описание истории ревизии №1 kubectl rollout undo deployment/nginx --to-revision=2 - откат к ревизии 2 -
Nurlan199206 revised this gist
May 18, 2019 . 1 changed file with 16 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -95,11 +95,26 @@ kubectl delete pvc NAME - удаление claim kubectl get pvc NAME_PV - Вывод списка claim для PersistantVolume grafana-pv-volume - описание pvc ======================secrets==================================== kubectl create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt - создать secret db-user-pass на основе файлов kubectl get secrets - вывод списка для secrets kubectl describe secrets/db-user-pass kubectl get secret db-user-pass -o yaml - вывод логина и пароля secret db-user-pass =====================network===================================== kubectl expose deployment hello-world --type=LoadBalancer --name=my-service - создание Service для Deployment hello-world с типом лоадбалансера. =====================load balancer=============================== 1. Пример лоад балансера между 5 подами. kubectl run hello-world --replicas=5 --labels="run=load-balancer-example" --image=gcr.io/google-samples/node-hello:1.0 --port=8080 kubectl expose deployment hello-world --type=LoadBalancer --name=my-service =================== -
Nurlan199206 revised this gist
May 17, 2019 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -93,4 +93,13 @@ kubectl delete pv NAME - удаление тома PersistantVolume kubectl delete pvc NAME - удаление claim kubectl get pvc NAME_PV - Вывод списка claim для PersistantVolume ======================secrets==================================== kubectl create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt - создать secret db-user-pass на основе файлов kubectl get secrets - вывод списка для secrets kubectl describe secrets/db-user-pass kubectl get secret db-user-pass -o yaml - вывод логина и пароля secret db-user-pass -
Nurlan199206 revised this gist
May 15, 2019 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,8 @@ kubectl get pods && kubectl get services --all-namespaces kubectl get nodes - список нодов kubectl get pod redis --watch kubectl delete service,deployment nginx - удалить сервис и поды nginx kubectl get pod NAME --output=yaml - показать значение пода @@ -84,5 +86,11 @@ kubectl delete clusterrolebinding cluster-system-anonymous - удаление р kubectk get clusterrole - вывод списка ролей kubectl get clusterrole system:NAME -o yaml ====================volumes====================================== kubectl get pv NAME - вывод списка томов PersistantVolume kubectl delete pv NAME - удаление тома PersistantVolume kubectl delete pvc NAME - удаление claim kubectl get pvc NAME_PV - Вывод списка claim для PersistantVolume -
Nurlan199206 revised this gist
May 10, 2019 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,14 @@ kubernetes commands kubectl get pods && kubectl get services --all-namespaces kubectl get nodes - список нодов kubectl delete service,deployment nginx - удалить сервис и поды nginx kubectl get pod NAME --output=yaml - показать значение пода kubectl describe pod NAME --namespace=NAME - показать значения пода kubectl delete pod NAME --grace-period=0 --force kubectl logs NAME - посмотреть логи контейнера @@ -77,4 +83,6 @@ kubectl delete clusterrolebinding cluster-system-anonymous - удаление р kubectk get clusterrole - вывод списка ролей kubectl get clusterrole system:NAME -o yaml -
Nurlan199206 revised this gist
May 9, 2019 . 1 changed file with 27 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,11 @@ kubernetes commands kubectl get pods && kubectl get services --all-namespaces kubectl delete service,deployment nginx - удалить сервис и поды nginx kubectl delete pod NAME --grace-period=0 --force kubectl logs NAME - посмотреть логи контейнера kubectl exec -ti NAME bash - интерактивный режим bash @@ -12,6 +14,8 @@ kubectl expose deployment nginx --type=NodePort --port=80 - выставить kubectl create -f ingress.yml - создание точки входа ingress kubectl delete service NAME -n NAMESPACE kubectl delete service NAME kubectl delete deployment NAME @@ -24,6 +28,10 @@ kubectl rollout history deployment/nginx kubectl set resources deployment/nginx -c=nginx --limits=cpu=200m,memory=512Mi kubectl exec -ti -n monitoring prometheus-deployment-6bf45557bd-f5bvx -- /bin/sh ubectl --namespace kube-system delete deployment kubernetes-dashboard ==================rollout and rollback=============== kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.91 --record=true @@ -52,3 +60,21 @@ kubectl delete cronjob NAME kubectl get jobs --watch ========================Configmap================================ kubectl get configmap NAME -n NAMESPACE kubectl describe configmap NAME -n NAMESPACE kubectl delete configmap NAME -n NAMESPACE =======================proxy===================================== kubectl proxy --address="192.168.0.105" -p 8001 --accept-hosts='^*$' =====================clusterrole================================= kubectl delete clusterrolebinding cluster-system-anonymous - удаление роли в кластере kubectk get clusterrole - вывод списка ролей kubectl get clusterrole system:NAME -o yaml -
Nurlan199206 revised this gist
May 5, 2019 . 1 changed file with 19 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -28,12 +28,27 @@ kubectl set resources deployment/nginx -c=nginx --limits=cpu=200m,memory=512Mi kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.91 --record=true kubectl describe deployment - описать развертывание kubectl rollout history deployment/nginx - вывод истории развертывания kubectl rollout history deployment/nginx --revision=1 - откат к ревизии 1 kubectl rollout undo deployment/nginx --to-revision=2 - откат к ревизии 2 kubectl rollout status - проверить состояние развертывания ==================scale================================= kubectl scale deployment/nginx --replicas=10 ===================Cronjobs============================= kubectl create -f cronjob.yml kubectl get cronjob NAME kubectl delete cronjob NAME kubectl get jobs --watch -
Nurlan199206 revised this gist
May 3, 2019 . 1 changed file with 24 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ kubernetes commands kubectl get pods && kubectl get services kubectl delete service,deployment nginx - удалить сервис и поды nginx @@ -11,10 +12,28 @@ kubectl expose deployment nginx --type=NodePort --port=80 - выставить kubectl create -f ingress.yml - создание точки входа ingress kubectl delete service NAME kubectl delete deployment NAME kubectl get deployments - вывести список Deployments kubectl get rs - список ReplicaSet kubectl rollout history deployment/nginx kubectl set resources deployment/nginx -c=nginx --limits=cpu=200m,memory=512Mi ==================rollout and rollback=============== kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.91 --record=true kubectl describe deployment kubectl rollout history deployment/nginx kubectl rollout history deployment/nginx --revision=1 kubectl rollout undo deployment/nginx --to-revision=2 ==================scale================================= -
Nurlan199206 revised this gist
May 1, 2019 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -13,4 +13,8 @@ kubectl create -f ingress.yml - создание точки входа ingress kubectl delete ingress NAME kubectl get ingress kubectl delete service NAME kubectl delete deployment NAME -
Nurlan199206 revised this gist
Apr 30, 2019 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,4 +11,6 @@ kubectl expose deployment nginx --type=NodePort --port=80 - выставить kubectl create -f ingress.yml - создание точки входа ingress kubectl delete ingress NAME kubectl get ingress -
Nurlan199206 revised this gist
Apr 30, 2019 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,10 +3,12 @@ kubectl get pods && kubectl get services - список подов и серви kubectl delete service,deployment nginx - удалить сервис и поды nginx kubectl logs NAME - посмотреть логи контейнера kubectl exec -ti NAME bash - интерактивный режим bash kubectl expose deployment nginx --type=NodePort --port=80 - выставить сервис наружу kubectl create -f ingress.yml - создание точки входа ingress kubectl delete ingress NAME -
Nurlan199206 renamed this gist
Apr 30, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Nurlan199206 created this gist
Apr 30, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ kubectl get pods && kubectl get services - список подов и сервисов. IP:PORT kubectl delete service,deployment nginx - удалить сервис и поды nginx kubectl logs nginx-6dd86d77d-48tn4 - посмотреть логи контейнера kubectl exec -ti nginx-6dd86d77d-48tn4 bash - интерактивный режим bash kubectl expose deployment nginx --type=NodePort --port=80 - выставить сервис наружу kubectl create -f ingress.yml - создание точки входа ingress