Difference between revisions of "IT-SDK-Kubernetes-Basics"
Jump to navigation
Jump to search
Samerhijazi (talk | contribs) (→minikube) |
Samerhijazi (talk | contribs) (→kind) |
||
| Line 35: | Line 35: | ||
* https://kind.sigs.k8s.io/docs/user/quick-start/#installation | * https://kind.sigs.k8s.io/docs/user/quick-start/#installation | ||
<pre class="code"> | <pre class="code"> | ||
| − | curl | + | curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64 |
| − | + | curl.exe -Lo kind.exe https://kind.sigs.k8s.io/dl/v0.11.1/kind-windows-amd64 | |
</pre> | </pre> | ||
<pre class="code"> | <pre class="code"> | ||
| Line 46: | Line 46: | ||
kubectl cluster-info --context kind-kind | kubectl cluster-info --context kind-kind | ||
</pre> | </pre> | ||
| + | |||
=minikube= | =minikube= | ||
* https://minikube.sigs.k8s.io/docs/ | * https://minikube.sigs.k8s.io/docs/ | ||
Revision as of 15:50, 18 July 2021
Ref.
- https://kind.sigs.k8s.io/
- http://kubernetesbyexample.com/
- https://kubernetes.io/docs/reference/kubectl/cheatsheet/
Fast-Run
kubectl run --image=nginx -o yaml --dry-run=client > pod-defination.yaml kubectl create deployment --image=nginx --replicas=3 -o yaml --dry-run=client > deployment-defination.yaml
ServiceTypes
- ref: https://kubernetes.io/docs/concepts/services-networking/service/
- ClusterIP: Service is reachableonly from within the cluster.
- NodePort: Service is reachable from outside the cluster.
- LoadBalancer: Service is reachable from outside the cluster (Using a cloud provider's load balancer).
- ExternalName: t.b.d.
Probes
Bedeutung
- Probe: describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
- Liveness: to know when to restart a container.
- Readiness: to know when a container is ready to start accepting traffic.
- Startup: to know when a container application has started. If such a probe is configured, it disables liveness and readiness checks until it succeeds.
Settings
- initialDelaySeconds: wait x seconds before performing the first probe.
- periodSeconds: every x seconds to perform probe.
- timeoutSeconds: wait x seconds after which the probe times out.
- successThreshold: x times to considered successful after having failed (Defaults=1).
- failureThreshold: x times to giving up after fails (Defaults=3). Giving up in case of liveness probe means restarting the container.
kind
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64 curl.exe -Lo kind.exe https://kind.sigs.k8s.io/dl/v0.11.1/kind-windows-amd64
kind create cluster kind create cluster --name kind-2 kind get clusters kind delete cluster ... kubectl cluster-info --context kind-kind
minikube
minikube start minikube dashboard minikube stop #Halt the cluster: minikube config set memory 16384 #Set memory limit minikube addons list #Browse the catalog minikube start -p aged --kubernetes-version=v1.16.1 #Create a second cluster minikube delete --all #Delete all of the minikube