MicroK8s : Fluentd を有効にする2020/08/17 |
Fluentd アドオンを有効にして、MicroK8s クラスターで Elasticsearch, Fluentd, Kibana (EFK Stack) を構成します。
|
[1] | プライマリーノードで、Fluentd アドオンを有効にします。 |
[root@dlp ~]# microk8s enable fluentd dns Enabling Fluentd-Elasticsearch Labeling nodes node/dlp.srv.world labeled Enabling DNS Applying manifest serviceaccount/coredns created configmap/coredns created deployment.apps/coredns created service/kube-dns created clusterrole.rbac.authorization.k8s.io/coredns created clusterrolebinding.rbac.authorization.k8s.io/coredns created Restarting kubelet DNS is enabled service/elasticsearch-logging created serviceaccount/elasticsearch-logging created clusterrole.rbac.authorization.k8s.io/elasticsearch-logging created clusterrolebinding.rbac.authorization.k8s.io/elasticsearch-logging created statefulset.apps/elasticsearch-logging created configmap/fluentd-es-config-v0.1.5 created serviceaccount/fluentd-es created clusterrole.rbac.authorization.k8s.io/fluentd-es created clusterrolebinding.rbac.authorization.k8s.io/fluentd-es created daemonset.apps/fluentd-es-v2.2.0 created deployment.apps/kibana-logging created service/kibana-logging created Fluentd-Elasticsearch is enabled Addon dns is already enabled.[root@dlp ~]# microk8s kubectl get services -n kube-system NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE elasticsearch-logging ClusterIP 10.152.183.119 <none> 9200/TCP 54s kibana-logging ClusterIP 10.152.183.237 <none> 5601/TCP 54s kube-dns ClusterIP 10.152.183.10 <none> 53/UDP,53/TCP,9153/TCP 70s[root@dlp ~]# microk8s kubectl get pods -A NAMESPACE NAME READY STATUS RESTARTS AGE kube-system coredns-588fd544bf-jfwv2 1/1 Running 0 97s kube-system elasticsearch-logging-0 1/1 Running 0 81s kube-system fluentd-es-v2.2.0-gvf69 1/1 Running 0 81s kube-system kibana-logging-84f486f46b-v5ts4 1/1 Running 0 81s[root@dlp ~]# microk8s kubectl cluster-info Kubernetes master is running at https://127.0.0.1:16443 Elasticsearch is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy Kibana is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/kibana-logging/proxy CoreDNS is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy Metrics-server is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/https:metrics-server:/proxy # kube proxy を起動 # 必要に応じてアクセス許可範囲は変更 [root@dlp ~]# microk8s kubectl proxy --address=0.0.0.0 --accept-hosts=.* Starting to serve on [::]:8001 # Firewalld 稼働中の場合はポート許可 [root@dlp ~]# firewall-cmd --add-port=8001/tcp --permanent [root@dlp ~]# firewall-cmd --reload |
[2] | ローカルネットワーク内の任意のクライアントコンピューターで Web ブラウザーを起動し、 [http://(MicroK8s プライマリーノードのホスト名 または IP アドレス):8001/api/v1/namespaces/kube-system/services/kibana-logging/proxy] にアクセスして、Kibana のダッシュボードが表示されれば OK です。 |
Sponsored Link |