mirror of
https://github.com/balkian/gists.git
synced 2024-12-04 06:02:28 +00:00
This commit is contained in:
commit
240a7fe825
8
README.md
Normal file
8
README.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
```
|
||||||
|
kubectl apply -f pruebans1.yml
|
||||||
|
kubectl apply -f pruebans2.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl exec -ti $(kubectl get pods -n pruebans1 --no-headers -o custom-columns=":metadata.name") -n pruebans1 -- nslookup pruebans2.pruebans2
|
||||||
|
```
|
41
gistfile1.txt
Normal file
41
gistfile1.txt
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: pruebans2
|
||||||
|
---
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: pruebans2
|
||||||
|
name: pruebans2
|
||||||
|
namespace: pruebans2
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: pruebans2
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: busybox:1.28
|
||||||
|
name: pruebans2
|
||||||
|
command: [ "sh", "-c", "while true; do echo $(hostname); sleep 60; done" ]
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 80
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: pruebans2
|
||||||
|
namespace: pruebans2
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: pruebans2
|
||||||
|
port: 80
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 80
|
||||||
|
selector:
|
||||||
|
app: pruebans2
|
41
pruebans1.yml
Normal file
41
pruebans1.yml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: pruebans1
|
||||||
|
---
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: pruebans1
|
||||||
|
name: pruebans1
|
||||||
|
namespace: pruebans1
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: pruebans1
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: busybox:1.28
|
||||||
|
name: pruebans1
|
||||||
|
command: [ "sh", "-c", "while true; do echo $(hostname); sleep 60; done" ]
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 80
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: pruebans1
|
||||||
|
namespace: pruebans1
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: pruebans1
|
||||||
|
port: 80
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 80
|
||||||
|
selector:
|
||||||
|
app: pruebans1
|
Loading…
Reference in New Issue
Block a user