Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kubernetes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CAILLETTAUD Remi
kubernetes
Commits
e41193cc
Commit
e41193cc
authored
2 years ago
by
remche
Browse files
Options
Downloads
Patches
Plain Diff
better coredns test
parent
e4537e00
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+10
-10
10 additions, 10 deletions
README.md
with
10 additions
and
10 deletions
README.md
+
10
−
10
View file @
e41193cc
...
...
@@ -84,33 +84,33 @@ kubectl top pods -A
Pour tester le service de DNS (qui est derrière le mécanisme de
*Service Discovery*
), lançez un pod nginx et vérifiez qu'il tourne :
```
bash
kubectl run
--image
nginx
web
kubectl expose pod
web
--port
80
kubectl run
--image
nginx
nginx-pod
kubectl expose pod
nginx-pod
--port
80
kubectl get pods
-o
wide
pod_ip
=
$(
kubectl get pod nginx-pod
-o
jsonpath
=
'{.status.podIP}'
)
kubectl get service
service_ip
=
$(
kubectl get service nginx-pod
-o
jsonpath
=
'{.spec.clusterIP}'
)
```
Essayez de l'atteindre depuis un autre pod, via son IP, l'IP du service, puis le nom DNS du service :
```
bash
kubectl run
--rm
--restart
=
Never
-i
-t
--image
busybox
test
/bin/sh
wget
-O-
$ip_du_pod_nginx
wget
-O-
$ip_du_service
wget
-O-
web
kubectl run
--rm
--restart
=
Never
-it
--image
busybox
test
--
wget
-O-
$pod_ip
kubectl run
--rm
--restart
=
Never
-it
--image
busybox
test
--
wget
-O-
$service_ip
kubectl run
--rm
--restart
=
Never
-it
--image
busybox
test
--
wget
-O-
nginx-pod
```
Déployez CoreDNS, vérifiez qu'il tourne bien et testez à nouveau la résolution DNS :
```
bash
microk8s
enable
dns
kubectl get pods
-A
kubectl run
--rm
--restart
=
Never
-i
-t
--image
busybox
test
/bin/sh
wget
-O-
web
kubectl run
--rm
--restart
=
Never
-it
--image
busybox
test
--
wget
-O-
nginx-pod
```
### Nettoyage
```
bash
kubectl delete service
web
kubectl delete pod
web
kubectl delete service
nginx-pod
kubectl delete pod
nginx-pod
```
## Vapormap
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment