mirror of
https://github.com/kelseyhightower/kubernetes-the-hard-way.git
synced 2025-12-15 17:28:58 +03:00
Apply Markdown best practices (block code language specification, spacing between lines, spacing between char, ...
This commit is contained in:
@@ -6,13 +6,13 @@ In this lab you will deploy the [DNS add-on](https://kubernetes.io/docs/concepts
|
||||
|
||||
Deploy the `coredns` cluster add-on:
|
||||
|
||||
```
|
||||
```bash
|
||||
kubectl apply -f https://storage.googleapis.com/kubernetes-the-hard-way/coredns.yaml
|
||||
```
|
||||
|
||||
> output
|
||||
|
||||
```
|
||||
```bash
|
||||
serviceaccount/coredns created
|
||||
clusterrole.rbac.authorization.k8s.io/system:coredns created
|
||||
clusterrolebinding.rbac.authorization.k8s.io/system:coredns created
|
||||
@@ -23,13 +23,13 @@ service/kube-dns created
|
||||
|
||||
List the pods created by the `kube-dns` deployment:
|
||||
|
||||
```
|
||||
```bash
|
||||
kubectl get pods -l k8s-app=kube-dns -n kube-system
|
||||
```
|
||||
|
||||
> output
|
||||
|
||||
```
|
||||
```bash
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
coredns-699f8ddd77-94qv9 1/1 Running 0 20s
|
||||
coredns-699f8ddd77-gtcgb 1/1 Running 0 20s
|
||||
@@ -39,38 +39,38 @@ coredns-699f8ddd77-gtcgb 1/1 Running 0 20s
|
||||
|
||||
Create a `busybox` deployment:
|
||||
|
||||
```
|
||||
```bash
|
||||
kubectl run --generator=run-pod/v1 busybox --image=busybox:1.28 --command -- sleep 3600
|
||||
```
|
||||
|
||||
List the pod created by the `busybox` deployment:
|
||||
|
||||
```
|
||||
```bash
|
||||
kubectl get pods -l run=busybox
|
||||
```
|
||||
|
||||
> output
|
||||
|
||||
```
|
||||
```bash
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
busybox 1/1 Running 0 3s
|
||||
```
|
||||
|
||||
Retrieve the full name of the `busybox` pod:
|
||||
|
||||
```
|
||||
```bash
|
||||
POD_NAME=$(kubectl get pods -l run=busybox -o jsonpath="{.items[0].metadata.name}")
|
||||
```
|
||||
|
||||
Execute a DNS lookup for the `kubernetes` service inside the `busybox` pod:
|
||||
|
||||
```
|
||||
```bash
|
||||
kubectl exec -ti $POD_NAME -- nslookup kubernetes
|
||||
```
|
||||
|
||||
> output
|
||||
|
||||
```
|
||||
```bash
|
||||
Server: 10.32.0.10
|
||||
Address 1: 10.32.0.10 kube-dns.kube-system.svc.cluster.local
|
||||
|
||||
|
||||
Reference in New Issue
Block a user