Kubernetes Getting Started
Kubernetes Getting Started
Kubernetes Getting Started
https://youtu.be/d6WC5n9G_sM
bogdan stashchuk
2 CPUs or more
2GB of free memory
20GB of free disk space
Internet connection
Container or virtual machine manager, such as: Hyper-V,
minikube ip
172.21.97.9
ssh docker@172.21.97.9
yes
tcuser
docker ps
kubectl n'est pas disponible à l'intérieur d'un node
exit
kubectl cluster-info
CoreDNS is running at
https://172.21.97.9:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
pod/nginx created
42:33
https://pcsoftstore.com/intellij-idea-cracked-august-2022-version-download/
1:22
Introduction Stashchuk
Kuernetes allows you to create containers on differents servers physical or virtual, all of that
is done automatically without your intervention. You have just to tell kubernetes how many
containers you would like to create based on specific image.
K U B E R N E T E S = k8s
K8s takes care of automatic deployment across different servers located on physical or
virtual
If you want to create deployment for your application inside the kubernetes cluster opened
to outside world, you could create load balancer ip address
Login Succeeded
Logging in with your password grants your terminal complete access to your account.
For better security, log in with a limited-privilege personal access token. Learn more at
https://docs.docker.com/go/access-tokens/
92fcf09fbe1b: Pushed
d3dfad599d52: Pushed
baa77b9f25ff: Pushed
07f1e273e35f: Pushed
latest: digest:
sha256:95ccc5800c8da7b03aa3b3c77c36f94fbe7bd3a7dda2518b6d89b056bd06ca35 size:
1992
this image is public and you are able to utilize it in kubernetes deployment. We are able to
create Kubernetes deployment based on this image
Unable to connect to the server: dial tcp 172.21.97.9:8443: connectex: A connection attempt
failed because the connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond.
This problem occurs because of minikube. Restart minikube will solve this problem.Run
below command and it will work-
minikube stop
minikube delete
minikube start
minikube start --driver=hyperv
minikube stop
minikube delete
minikube start
minikube start --driver=hyperv
1:40:25
deployment.apps/k8s-web-hello created
service/k8s-web-hello exposed
minikube ip
172.30.128.92
ssh docker@172.30.128.92
docker@172.30.128.92's password:tcuser
curl 10.106.129.58:3000
1:48:51
let’s modify type of service which we created for our deployment
service/k8s-web-hello exposed
minikube ip
172.30.128.92
I could take this ip and this port, and I would connect to one of the port, pasting this url on a
browser
http://172.30.128.92:31837
there is simple way to get url for this deployment, just typing
|-----------|---------------|-------------|----------------------------|
|-----------|---------------|-------------|----------------------------|
|-----------|---------------|-------------|----------------------------|
http://172.30.128.92:31837
service/k8s-web-hello exposed
http://172.30.128.92:31230
Name: k8s-web-hello
Namespace: default
Labels: app=k8s-web-hello
Annotations: deployment.kubernetes.io/revision: 1
Selector: app=k8s-web-hello
StrategyType: RollingUpdate
MinReadySeconds: 0
Pod Template:
Labels: app=k8s-web-hello
Containers:
k8s-web-hello:
Image: aunanant/k8s-web-hello
Port: <none>
Environment: <none>
Mounts: <none>
Volumes: <none>
Conditions:
OldReplicaSets: <none>
Events: <none>
Let’s try to update version image of our deployment, RollingUpdate on passe d’une version à
une autre sans interruption
New pods will be created with new image, while old pods still running
1:59:30
minikube ip
172.19.140.80
declarative approach
2:10
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
spec:
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: <Image>
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: <Port>
apiVersion: apps/v1
kind: Deployment
metadata:
name: k8s-web-hello
spec:
selector:
matchLabels:
app: k8s-web-hello
template:
metadata:
labels:
app: k8s-web-hello
spec:
containers:
mink - name: k8s-web-hello
image: aunanant/k8s-web-hello
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 3000
PS C:\Users\jclon\k8s>
kubectl apply -f .\deployment.yaml
deployment.apps/k8s-web-hello created
spec:
replicas: 5
selector:
matchLabels:
app: k8s-web-hello
template:
metadata:
labels:
app: k8s-web-hello
deployment.apps/k8s-web-hello configured
apiVersion: v1
kind: Service
metadata:
name: myapp
spec:
selector:
app: myapp
ports:
- port: <Port>
targetPort: <Target Port>
apiVersion: v1
kind: Service
metadata:
name: k8s-web-hello
spec:
type: LoadBalancer
selector:
app: k8s-web-hello
ports:
- port: 3030
targetPort: 3000
service/k8s-web-hello created
|-----------|---------------|-------------|----------------------------|
|-----------|---------------|-------------|----------------------------|
|-----------|---------------|-------------|----------------------------|
https://apexapps.oracle.com/pls/apex/r/dbpm/livelabs/run-workshop?
p210_wid=3070&p210_wec=&session=1893876604080
3 Deploy SpringBoot with MySQL to Kubernetes (Minikube) –
Step by Step Tutorial
https://www.kindsonthegenius.com/deploy-springboot-with-mysql-to-kubernetes-
minikube-step-by-step-tutorial/