Tutorial Perintah Umum di Microk8s Kubernetes

Pada tutorial lanjutan kali ini, kita akan mengenal tutorial perintah umum dari penggunaan microk8s. Bagi yang belum menginstall microk8s, silakan lihat tutorial sebelumnya.

perintah pertama, cek status dari microk8s:

[sourcecode]microk8s status[/sourcecode]

dengan hasil seperti ini:

microk8s is running
high-availability: no
  datastore master nodes:
  datastore standby nodes: none
    ha-cluster           # Configure high availability on the current node
    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
    keda                 # Kubernetes-based Event Driven Autoscaling
    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
    portainer            # Portainer UI for your Kubernetes cluster
    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
    traefik              # traefik Ingress controller for external access

Start Cluster

[sourcecode]microk8s start[/sourcecode]

dengan hasil:

microk8s is running
high-availability: no
  datastore master nodes:
  datastore standby nodes: none

Stop Cluster

[sourcecode]microk8s stop[/sourcecode]

List Node dari Cluster

[sourcecode]microk8s kubectl get nodes[/sourcecode]

contoh outputnya:

sudo microk8s kubectl get nodes
srv101149   Ready       13m   v1.20.0-37+7ab055a22f5440

Disable Cluster

[sourcecode]sudo snap disable microk8s[/sourcecode]

Enable Cluster

[sourcecode]sudo snap enable microk8s[/sourcecode]

Deploy Pods

[sourcecode]microk8s kubectl create deployment my-redis –image=redis[/sourcecode]

List Pod dalam Cluster

[sourcecode]microk8s kubectl get pods –all-namespaces[/sourcecode]

Scroll to Top