Kubernetes Port Forwarding with kubefwd on Apple M1

Hits: 265

kubefwd is a command line tool for Kubernetes Services and allows you to access any service from your local workstation in the same namespace on cluster. kubefwd temporally adds domain records to our /etc/hosts file with the service names it forwards.

Here is explaining the workflow from official GitHub repository:

https://github.com/txn2/kubefwd

and Screencast (it’s also from GitHub repository)

https://github.com/txn2/kubefwd

Installation with homebrew

  1. Requirement
    1. kubectl kubefwd assumes you have kubectl installed and configured with cluster access.

You can install kubefwd directly from txn2/tap.

brew install txn2/tap/kubefwd

To upgrade:

brew upgrade kubefwd

Testing

Create and run forwarding

Open Gitea-Service and install it. After installation i have a new repo created and my ssh key in to the my gitea profile added.

Cloning, Pushing…

Gitea Dashboard

Gitea Installation via Helm on Apple M1

Hits: 50

Gitea? is aa community developed and managed simple, lightweight github alternative, written in Go.

Gitea provides a Helm Cart for installation on kubernetes, thats mean, if we would like to customize our install, we can do this.. But when not, we can directly use without any custom configuration/helm config.

Installation

helm repo add gitea-charts https://dl.gitea.io/charts/
helm repo update && helm install gitea gitea-charts/gitea
MBP-von-Koray ~ % helm repo update && helm install gitea gitea-charts/gitea
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "gitea-charts" chart repository
Update Complete. ⎈Happy Helming!⎈
NAME: gitea
LAST DEPLOYED: Sun Aug  1 14:07:36 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
  echo "Visit http://127.0.0.1:3000 to use your application"
  kubectl --namespace default port-forward svc/gitea-http 3000:3000

And starting port-forwarding for Port 3000.

kubectl --namespace default port-forward svc/gitea-http 3000:3000

and here is.. Enjoy 😊

To customize your install, here is the complete configuration details.

Helm CLI installation on Apple M1

Hits: 1511

Helm? is a package manager for Kubernetes. Helm uses a packaging format, this called “charts”.

Chart? is a collection of files, what be describe Kubernetes resources, like a Server, Database, Caches or simple deploy pod.

Check first first which version as lastest for ARM64 released : https://github.com/helm/helm/releases.

Installation Step

Run following console commands in command line. IMPORTANT! Don’t Forget replacing this LASTEST-RELEASE-HERE tag with latest release/version from https://github.com/helm/helm/releases. For example

  • Download your Helm CLI Binary
curl -O https://get.helm.sh/helm-LASTEST-RELEASE-HERE-darwin-arm64.tar.gz
  • Unpack it
tar -zxvf helm-LASTEST-RELEASE-HERE-linux-amd64.tar.gz
  • And Move it to bin location
sudo mv darwin-arm64/helm /usr/local/bin/helm

and, you should be able to run, check with this command and see the output

koray@MBP-von-Koray ~ % helm help
The Kubernetes package manager

Common actions for Helm:

- helm search:    search for charts
- helm pull:      download a chart to your local directory to view
- helm install:   upload the chart to Kubernetes
- helm list:      list releases of charts

Environment variables:

| Name                               | Description                                                                       |
|------------------------------------|-----------------------------------------------------------------------------------|
| $HELM_CACHE_HOME                   | set an alternative location for storing cached files.                             |
| $HELM_CONFIG_HOME                  | set an alternative location for storing Helm configuration.                       |
| $HELM_DATA_HOME                    | set an alternative location for storing Helm data.                                |
| $HELM_DEBUG                        | indicate whether or not Helm is running in Debug mode                             |
| $HELM_DRIVER                       | set the backend storage driver. Values are: configmap, secret, memory, postgres   |
........
......
.....

Example Steps with Today’s version

koray@MBP-von-Koray ~ % curl -O https://get.helm.sh/helm-v3.6.3-darwin-arm64.tar.gz
koray@MBP-von-Koray ~ % tar -zxvf helm-v3.6.3-darwin-arm64.tar.gz 
koray@MBP-von-Koray ~ % sudo mv darwin-arm64/helm /usr/local/bin/helm

Minikube on an Apple M1

Hits: 920

Minikube? is local Kubernetes.

Kubernetes? is open source portable and flexible platform for managing containerized services, we have also declarative configuration and automation for services.

Docker Desktop on Apple M1

First thing, what we needed, it’s a Docker Desktop App for Apple Silicon.

Please check the Official Installation Guide, if installation steps changes has or new steps added..)

Docker Installation on Apple M1:

  • Download Docker Setup
  • Install Rosetta 2 Binaries
    • To install manually from the command line, run the following command
softwareupdate --install-rosetta

Important We Starting the Docker Desktop app after installation! (because i don’t did that!!!)

ok, so now docker desktop up and running…

Minikube

Minikube also has Official Installation Guide, please check the Official documentation, if the steps has changes or new steps added.

Why? because Docker and Minikube working ever day for integration for Apple Silicon, that means for us, the Installation Requirements or steps can be changes in the future.

Today’s minikube installation Steps, run following command in command line.

  • Download Minikube release
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64
  • Install Minikube
sudo install minikube-darwin-amd64 /usr/local/bin/minikube

After Minikube Installation, we should be able to start minikube. Actually one drive supported. Its’a docker, that means, we must be the driver as argument for minikube start given.

minikube start --driver=docker

with this command, minikube will download kubernetes required docker images, this can take a little longer.

everything looks good and minikube working very well. Let’s starting we the dashboard.. for that run followed single command in command line.

minikube dashboard

and here is..