From 240a7fe825df11a00a95ba46b32011330e92b870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Tue, 6 Nov 2018 10:39:55 +0100 Subject: [PATCH] --- README.md | 8 ++++++++ gistfile1.txt | 41 +++++++++++++++++++++++++++++++++++++++++ pruebans1.yml | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 README.md create mode 100644 gistfile1.txt create mode 100644 pruebans1.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..68b2156 --- /dev/null +++ b/README.md @@ -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 +``` diff --git a/gistfile1.txt b/gistfile1.txt new file mode 100644 index 0000000..3b39469 --- /dev/null +++ b/gistfile1.txt @@ -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 \ No newline at end of file diff --git a/pruebans1.yml b/pruebans1.yml new file mode 100644 index 0000000..ca86aaf --- /dev/null +++ b/pruebans1.yml @@ -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