'전체 글'에 해당되는 글 68건

Service 재시작 하기

아래의 명령으로 Service 를 재시작할 수 있다. # kubectl get svc -n -o yaml | kubectl replace --force -f-

Kubernetes | 2019. 7. 25. 19:25

[SSL] crt 인증서 pem 으로 변경하기

crt 인증서 pem 인증서로 변경 $ openssl x509 -in input-file.crt -out output-file.pem -outform PEM

Web | 2019. 7. 24. 16:51

EKS 쿠버네티스 대시보드 접속

kube-proxy 실행 $ kubectl proxy --port=8080 --address=0.0.0.0 --disable-filter=true & 토큰 출력 (awscli + jq) $ aws eks get-token --cluster-name dev-opgg-seoul | jq -r '.status.token' 토큰 출력 (kubtctl) $ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep eks-admin | awk '{print $1}') 접속 URL ( 토큰 입력) http://localhost:8080/api/v1/namespaces/kube-system/services/https:kuberne..

Kubernetes | 2019. 7. 23. 10:38

mongod log file 관리

간혹 log 파일 사이즈가 계속 늘어나서 디스크가 꽉차는 문제가 일어나서 log 파일에 logrotate 를 적용시켰다.  ## /etc/mongod.conf ##systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log logRotate: reopen # logrotate 적용을 위해서 추가  ## mongod 서비스 재시작 ### systemctl restart mongod.service  ## logrotate 설정 추가 - /etc/logrotate.d/mongod ##/var/log/mongodb/mongod.log { daily size 100M rotate 10 missingok compress..

mongoDB | 2019. 7. 19. 14:02

Slack으로 메시지 보내기

Slack API 에서 bot을 생성한 후에 발급받은 토큰을 통해서 Slack 으로 메시지를 보내는 방법이다. from slacker import Slacker def SendtoSlack(post_channel, post_massage): token = 'xoxb-xxxxxxxxxx-yyyyyyyyyyyy-zzzzzzzzzzzzzzzzzzzzzzzz' slack = Slacker(token) slack.chat.post_message(channel=post_channel, text=post_massage) if __name__ == '__main__': result = SendtoSlack('#bot-test', 'slockbot test') 다른 파일에서 사용가능하다. from SendtoSlack ..

Python | 2019. 7. 17. 12:00

파일을 읽어 줄 단위로 배열에 입력

파일을 읽어서 배열에 넣어주는 방법이다. ./files/checkfile.txt 의 내용을 줄단위로 배열에 입력하여, contents 와 동일한 내용이 있는지 확인하여 동일한 내용이 있으면 1 을 리턴한다. 문자열 비교시 배열에 newline("\n")이 추가있는 것을, .rstrip 으로 제거하였다. def Check_FileContentsMatch(inputfile, querystring): result = 0 with open(inputfile) as data: lines = data.readlines() for string in lines: if querystring == string.rstrip('\n'): result = 1 return result if __name__ == '__main__..

Python | 2019. 7. 16. 18:45