[preflight/images] Pulling images required for setting up a Kubernetes cluster
[preflight/images] This might take a minute or two, depending on the speed of yo ur internet connection
[preflight/images] You can also perform this action in beforehand using 'kubeadm config images pull'
[kubelet] Writing kubelet environment file with flags to file "/var/lib/kubelet/ kubeadm-flags.env"
[kubelet] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[preflight] Activating the kubelet service
[certificates] Generated ca certificate and key.
[certificates] Generated apiserver certificate and key.
[certificates] apiserver serving cert is signed for DNS names [test-k8s-master-n cl kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.c luster.local] and IPs [10.96.0.1 10.106.234.130]
[certificates] Generated apiserver-kubelet-client certificate and key.
[certificates] Generated sa key and public key.
[certificates] Generated front-proxy-ca certificate and key.
[certificates] Generated front-proxy-client certificate and key.
[certificates] Generated etcd/ca certificate and key.
[certificates] Generated etcd/server certificate and key.
[certificates] etcd/server serving cert is signed for DNS names [test-k8s-master -ncl localhost] and IPs [127.0.0.1 ::1]
[certificates] Generated etcd/peer certificate and key.
[certificates] etcd/peer serving cert is signed for DNS names [test-k8s-master-n cl localhost] and IPs [10.106.234.130 127.0.0.1 ::1]
[certificates] Generated etcd/healthcheck-client certificate and key.
[certificates] Generated apiserver-etcd-client certificate and key.
[certificates] valid certificates and keys now exist in "/etc/kubernetes/pki"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/admin.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/kubelet.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/controller-manager. conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/scheduler.conf"
[controlplane] wrote Static Pod manifest for component kube-apiserver to "/etc/k ubernetes/manifests/kube-apiserver.yaml"
[controlplane] wrote Static Pod manifest for component kube-controller-manager t o "/etc/kubernetes/manifests/kube-controller-manager.yaml"
[controlplane] wrote Static Pod manifest for component kube-scheduler to "/etc/k ubernetes/manifests/kube-scheduler.yaml"
[etcd] Wrote Static Pod manifest for a local etcd instance to "/etc/kubernetes/m anifests/etcd.yaml"
[init] waiting for the kubelet to boot up the control plane as Static Pods from directory "/etc/kubernetes/manifests"
[init] this might take a minute or longer if the control plane images have to be pulled
[apiclient] All control plane components are healthy after 40.501916 seconds
[uploadconfig] storing the configuration used in ConfigMap "kubeadm-config" in t he "kube-system" Namespace
[kubelet] Creating a ConfigMap "kubelet-config-1.11" in namespace kube-system wi th the configuration for the kubelets in the cluster
[markmaster] Marking the node test-k8s-master-ncl as master by adding the label "node-role.kubernetes.io/master=''"
[markmaster] Marking the node test-k8s-master-ncl as master by adding the taints [node-role.kubernetes.io/master:NoSchedule]
[patchnode] Uploading the CRI Socket information "/var/run/dockershim.sock" to t he Node API object "test-k8s-master-ncl" as an annotation
[bootstraptoken] using token: pvpoff.3gi89fsxl6q6vq21
[bootstraptoken] configured RBAC rules to allow Node Bootstrap tokens to post CS Rs in order for nodes to get long term certificate credentials
[bootstraptoken] configured RBAC rules to allow the csrapprover controller autom atically approve CSRs from a Node Bootstrap Token
[bootstraptoken] configured RBAC rules to allow certificate rotation for all nod e client certificates in the cluster
[bootstraptoken] creating the "cluster-info" ConfigMap in the "kube-public" name space
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy
Your Kubernetes master has initialized successfully!
To start using your cluster, you need to run the following as a regular user:
유튜브의 최신 인기자료를 카테고리별로 가져와서, 내 사이트에 자동 업로드하는 절차 입니다.
가급적 기초적인 크롤링 명령은 알고 하시는게 좋습니다.
■ 절차:
1. 크롤링 조건 정의
원하는 문자열 패턴과 조회수를 지정하여, 자동으로 검색 후 크롤링하는게 목적입니다.
아래의 경우는, 다음 3가지 조건을 만족하는 영상만 크롤링 하도록 정의하였습니다.
가. "군대" 관련 영상
나. 조회수 40만건 이상
다. 최근 1개월내의 자료
※ time.sleep을 정의 하지 않을 경우, 과다한 크롤링 요청으로 인해 유튜브측에서 Block할 수 있으므로 주의 하기 바랍니다.
######################################################################################################### # 군대 관련 영상 ######################################################################################################### BBS_CATEGORY="BBS_ARMY" ARMY=[ '군대', '해병', '해군', '특전사', '육군', '공군', '공수부대' ] # 해당 문자열 패턴이 있는 영상만 검색
Limit=len(ARMY) Gijun=400000 # 월간 40만건 이상 조회수 기록한 글만 크롤링 count=0
while count < Limit: KEY=str(str(ARMY[count]).encode('utf8')).replace("\\x","%").replace("b'","") URL="https://www.youtube.com/results?search_query="+KEY+"&sp=CAMSBAgEEAE%253D" # 월간 func_get_movie_list(URL, BBS_CATEGORY, Gijun) time.sleep(7) count+=1
2. 영상 정보 가져오기
조건별로 정의된 유튜브 URL을 자동으로 분류해서 가져옵니다.
영상링크, 제목, 조회수, 썸네일주소, 영상코드가 포함되므로, 필요한 형태로 변형해서 사용가능합니다.
[영상링크]https://www.youtube.com/watch?v=kINkPPx7Efk [제목][이춘근의 국제정치 75회] ① 美 국민, 74% 주한미군 주둔 찬성 [조회수]122067 [썸네일주소]https://i.ytimg.com/vi/kINkPPx7Efk/hqdefault.jpg [영상코드]kINkPPx7Efk [INFO] 처리 불가(조회수 적음) =>122067 [영상링크]https://www.youtube.com/watch?v=5NR0qckPk1E [제목][이춘근의 국제정치 75회] ② 방위비 분담금과 주한미군의 가치 [조회수]117454 [썸네일주소]https://i.ytimg.com/vi/5NR0qckPk1E/hqdefault.jpg [영상코드]5NR0qckPk1E [INFO] 처리 불가(조회수 적음) =>117454 [영상링크]https://www.youtube.com/watch?v=EYHQ6bAziXQ [제목]2부 일본은 이미 미군 철수에 3단계 대비 중 / 미 육군은 훈련 못하는 주한 미군 철수도 고민 [세밀한안보] (2019.01.28) [조회수]85377 [썸네일주소]https://i.ytimg.com/vi/EYHQ6bAziXQ/hqdefault.jpg [영상코드]EYHQ6bAziXQ [INFO] 처리 불가(조회수 적음) =>85377 [영상링크]https://www.youtube.com/watch?v=mHcAsGQnti4 [제목]미군, 북한 선제타격 준비! 브룩스 전 한미연합사령관 폭로! (전옥현 전 국정원 1차장) / 신의한수 [조회수]67698 [썸네일주소]https://i.ytimg.com/vi/mHcAsGQnti4/hqdefault.jpg [영상코드]mHcAsGQnti4 [INFO] 처리 불가(조회수 적음) =>67698 [영상링크]https://www.youtube.com/watch?v=C4fDWtY0IU0 [제목]진짜 엄청난 미군 항공모함들!니미츠급에서 포드급(CVN-68 ~ CVN-78 ) [조회수]65734 [썸네일주소]https://i.ytimg.com/vi/C4fDWtY0IU0/hqdefault.jpg [영상코드]C4fDWtY0IU0 [INFO] 처리 불가(조회수 적음) =>65734
3. 영상 정보 게시판에 업로드 하기
위 로직을 통해 데이터 크롤링까지 완료했습니다.
해당 데이터를 원하는 형태의 처리를 통해 DB 또는 게시물 형태로 변형하시면 얼마든지 재배포 가능합니다.