InfoHeap
Tech tutorials, tips, tools and more
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search
  • Home
  • > Kubernetes

Mac – enable and use kubernetes in docker

on Dec 30, 2022

Mac Docker comes with kubernetes embedded which can be enabled. Here the steps to enable and use kubernetes:

  1. Click on settings icons in Docker desktop, select Kubernetes menu item and select “Enable Kubernetes” and “Show system containers”. Then click apply and restart.
  2. This will also install kubectl in /user/local/
    $ ls -l /usr/local/bin/kubectl
    lrwxr-xr-x  1 root  wheel  55 Dec 11 20:22 /usr/local/bin/kubectl -> /Applications/Docker.app/Contents/Resources/bin/kubectl
  3. Install kubernetes dashboard
    kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
  4. Create service account by creating dashboard-adminuser.yaml with following content
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: admin-user
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: cluster-admin
    subjects:
    - kind: ServiceAccount
      name: admin-user
      namespace: kubernetes-dashboard

    And then run
    kubectl apply -f dashboard-adminuser.yaml
  5. Create token
    kubectl -n kubernetes-dashboard create token admin-user --duration=36000s
  6. Start proxy
    kubectl proxy
  7. View dashboard on the url http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
  8. Enter the token created above and click on sign in

Suggested posts:

  1. Mac m1 – How to Install Kubernetes with kind
  2. Mac m1 – How to Install Kubernetes with minikube
  3. Docker how to add a user to group docker on Linux
  4. Mac – docker sample – single container dev env – quick start
  5. minikube kubernetes – how to access specific pod IP endpoint using curl
  6. How to find docker host ip on Mac
  7. Docker quick start guide on Ubuntu
  8. Mac – kubernetes minikube – create deployment
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Kubernetes, Mac Docker
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries

Copyright © 2023 InfoHeap.

Powered by WordPress