Skip to content

Commit

Permalink
Update session 4 with working instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zed A. Shaw committed Jul 20, 2015
1 parent 55e8186 commit 8c960d1
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 33 deletions.
31 changes: 31 additions & 0 deletions cloneme/example.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include <sched.h>
#include <signal.h>
#include <unistd.h>

#define STACK_SIZE (1024 * 1024)

static char child_stack[STACK_SIZE];
char* const child_args[] = {
"/bin/bash",
NULL
};

int child_main(void* arg)
{
sethostname("In Namespace", 12);
execv(child_args[0], child_args);
return 1;
}

int main()
{
int child_pid = clone(child_main, child_stack+STACK_SIZE,
CLONE_NEWUTS | SIGCHLD, NULL);
waitpid(child_pid, NULL, 0);
return 0;
}

69 changes: 36 additions & 33 deletions session4/lecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,29 @@ We need a pod, and an image, which is your hello-node image.
Put It On The Internet
====

1. Go to the GCE GUI and set "Allow HTTP Traffic".
2. Go to the IP address on that page with your browser.
You can also use gcloud to expose ports, but it sometimes doesn't work:

kubectl get nodes

Get the part up-to-and-including the -node



Firewall Rules
====

gcloud compute firewall-rules create hello-world-8080 \
--allow tcp:8080 \
--target-tags <node-name-prefix>
kubectl expose rc hello-node --create-external-load-balancer=true
kubectl get services hello-node



Visit It
====

Visit the second IP address at port 8080.



Expand All @@ -112,6 +133,18 @@ All Commands Used



Firewall Commands
====

kubectl get nodes
gcloud compute firewall-rules create hello-world-8080 \
--allow tcp:8080 \
--target-tags <node-name-prefix>
kubectl expose rc hello-node --create-external-load-balancer=true
kubectl get services hello-node



Where These Are Documented
====

Expand All @@ -129,25 +162,6 @@ Command Line Help



Note on Ports and Firewalls
====

You can also use gcloud to expose ports, but it sometimes doesn't work:

kubectl get nodes
gcloud compute firewall-rules create hello-world-PORT --allow tcp:PORT \
--target-tags <node-name-prefix>
kubectl expose rc hello-node --create-external-load-balancer=true
kubectl get services hello-node



We'll Try That Next
====

If it doesn't work then just use the GUI.



Kubernetes Podwan Level 2
====
Expand Down Expand Up @@ -234,10 +248,8 @@ View And Deploy Wordpress
Expose Wordpress
====

We will try this, but use the GUI if it doesn't work:

kubectl get nodes
gcloud compute firewall-rules create wppd-world-80 --allow tcp:80 \
gcloud compute firewall-rules create wppd-80 --allow tcp:80 \
--target-tags gke-wppd-XXX-node
kubectl expose rc hello-node --create-external-load-balancer=true
kubectl get services hello-node
Expand All @@ -256,15 +268,6 @@ You've deployed from a docker and from YAML configurations.



But First, This Important Message
====

A video from Mesosphere showing Kubernets on DCOS making all of this even easier.

k8s-on-dcos-voiceover.mp4



End Of Lecture
=====

Expand Down

0 comments on commit 8c960d1

Please sign in to comment.