| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

MicroK8s

提供: MyMemoWiki
2020年10月29日 (木) 11:05時点におけるPiroto (トーク | 投稿記録)による版 (→‎Kubectl)
ナビゲーションに移動 検索に移動

| Kubernetes | Docker |

MicroK8s

Macにインストール

インストール

$ brew install ubuntu/microk8s/microk8s
$ microk8s install
$ microk8s status --wait-ready
microk8s is running
high-availability: no
  datastore master nodes: 127.0.0.1:19001
  datastore standby nodes: none
addons:
  enabled:
    ha-cluster           # Configure high availability on the current node
  disabled:
    ambassador           # Ambassador API Gateway and Ingress
    cilium               # SDN, fast with full network policy
    dashboard            # The Kubernetes dashboard
    dns                  # CoreDNS
    fluentd              # Elasticsearch-Fluentd-Kibana logging and monitoring
    gpu                  # Automatic enablement of Nvidia CUDA
    helm                 # Helm 2 - the package manager for Kubernetes
    helm3                # Helm 3 - Kubernetes package manager
    host-access          # Allow Pods connecting to Host services smoothly
    ingress              # Ingress controller for external access
    istio                # Core Istio service mesh services
    jaeger               # Kubernetes Jaeger operator with its simple config
    knative              # The Knative framework on Kubernetes.
    kubeflow             # Kubeflow for easy ML deployments
    linkerd              # Linkerd is a service mesh for Kubernetes and other frameworks
    metallb              # Loadbalancer for your Kubernetes cluster
    metrics-server       # K8s Metrics Server for API access to service metrics
    multus               # Multus CNI enables attaching multiple network interfaces to pods
    prometheus           # Prometheus operator for monitoring and logging
    rbac                 # Role-Based Access Control for authorisation
    registry             # Private image registry exposed on localhost:32000
    storage              # Storage class; allocates storage from host directory

サービスの有効化/無効化

  • 組み込みで有効化可能なアドオンサービスの確認
  • サービスを無効化する場合は、disable
$ microk8s enable --help
  • サービスを有効化する
$ microk8s enable dashboard dns registry istio

Kubectl

$ microk8s kubectl get all --all-namespaces
NAMESPACE            NAME                                             READY   STATUS              RESTARTS   AGE
kube-system          pod/calico-node-m9j8n                            1/1     Running             0          90m
kube-system          pod/metrics-server-8bbfb4bdb-679mc               1/1     Running             0          7m38s
            :


https://hondou.homedns.org/pukiwiki/index.php?k8s%20microK8s

$ token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)
$ microk8s kubectl -n kube-system describe secret $token
$ microk8s kubectl port-forward -n kube-system service/kubernetes-dashboard 10443:443

https://127.0.0.1:10443