How can I use local docker images with Minikube?

As the handbook describes, you can reuse the Docker daemon from Minikube with eval $(minikube docker-env). So to use an image without uploading it, you can follow these steps: Set the environment variables with eval $(minikube docker-env) Build the image with the Docker daemon of Minikube (e.g., docker build -t my-image .) Set the image … Read more

Downgrade kubectl version to match minikube k8s version

You can just download the previous version binary and replace the one you have now. Linux: curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/linux/amd64/kubectl chmod +x ./kubectl sudo mv ./kubectl /usr/local/bin/kubectl macOS: curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/darwin/amd64/kubectl chmod +x ./kubectl sudo mv ./kubectl /usr/local/bin/kubectl Windows: curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/windows/amd64/kubectl.exe And add it to PATH. If not follow instructions for other Operating Systems here: … Read more

Kubernetes: How to delete PODs based on age/creation time

This command will delete all PODs older than one day : kubectl get pods -o go-template –template ‘{{range .items}}{{.metadata.name}} {{.metadata.creationTimestamp}}{{“\n”}}{{end}}’ | awk ‘$2 <= “‘$(date -d ‘yesterday’ -Ins –utc | sed ‘s/+0000/Z/’)'” { print $1 }’ | xargs –no-run-if-empty kubectl delete pod This command will delete all PODs older than 4 hours : kubectl get … Read more

How to start a pod in command line without deployment in kubernetes?

kubectl run nginx –image=nginx –port=80 –restart=Never –restart=Always: The restart policy for this Pod. Legal values [Always, OnFailure, Never]. If set to Always a deployment is created, if set to OnFailure a job is created, if set to Never, a regular pod is created. For the latter two –replicas must be 1. Default Always […] see … Read more

Kubernetes – How to define ConfigMap built using a file in a yaml?

Your config.json file should be inside your mychart/ directory, not inside mychart/templates Chart Template Guide configmap.yaml apiVersion: v1 kind: ConfigMap metadata: name: {{ .Release.Name }}-configmap data: config.json: |- {{ .Files.Get “config.json” | indent 4}} config.json { “val”: “key” } helm install –dry-run –debug mychart [debug] Created tunnel using local port: ‘52091’ [debug] SERVER: “127.0.0.1:52091” … … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)