Signed-off-by: Arnaud Morin <arnaud.morin@ovhcloud.com>
This commit is contained in:
parent
395d00839a
commit
4b7cfe91f6
|
@ -1,14 +1,21 @@
|
||||||
|
|
||||||
# Before starting
|
# Before starting
|
||||||
|
## Connect
|
||||||
|
You are going to connect to a server using `ssh`.
|
||||||
|
|
||||||
|
Ask your teacher for the IP address of the machine:
|
||||||
|
|
||||||
|
```
|
||||||
|
ssh root@ip_address
|
||||||
|
```
|
||||||
|
|
||||||
## Host and Demo
|
## Host and Demo
|
||||||
You are currently connected to a server which have docker installed.
|
You are currently connected to a server which have docker installed.
|
||||||
We will call this server: `localhost`.
|
We will call this server: `localhost`.
|
||||||
|
|
||||||
You also have a docker container running in the background.
|
You also have a docker container running in the background.
|
||||||
We will call this container: `demo`.
|
|
||||||
|
|
||||||
You can check your containers with:
|
We will call this container: `demo`.
|
||||||
`docker ps`
|
|
||||||
|
|
||||||
During these lessons, you will be ask to use ansible to configure both `localhost` and `demo`
|
During these lessons, you will be ask to use ansible to configure both `localhost` and `demo`
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,15 @@ function title.print {
|
||||||
|
|
||||||
exec &> >(log_handler)
|
exec &> >(log_handler)
|
||||||
|
|
||||||
|
title.print "Permit root login"
|
||||||
|
echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config
|
||||||
|
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
|
||||||
|
echo '' > /root/.ssh/authorized_keys
|
||||||
|
echo -e "moutarde42\nmoutarde42" | passwd root
|
||||||
|
systemctl restart sshd
|
||||||
|
|
||||||
title.print "Install some packages"
|
title.print "Install some packages"
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
|
|
||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
apt-transport-https \
|
apt-transport-https \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
|
@ -40,6 +45,12 @@ apt-get install -y \
|
||||||
tmux
|
tmux
|
||||||
# nginx \
|
# nginx \
|
||||||
|
|
||||||
|
title.print "Configuring tmux and plik"
|
||||||
|
wget https://www.arnaudmorin.fr/tmux.conf -O /root/.tmux.conf
|
||||||
|
wget https://www.arnaudmorin.fr/plikrc -O /root/.plikrc
|
||||||
|
wget https://www.arnaudmorin.fr/plik -O /usr/local/bin/plik
|
||||||
|
chmod +x /usr/local/bin/plik
|
||||||
|
|
||||||
title.print "Install docker"
|
title.print "Install docker"
|
||||||
|
|
||||||
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
|
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
|
||||||
|
|
|
@ -55,8 +55,6 @@ kubectl expose deployment first-dep --type=LoadBalancer --port=8080
|
||||||
|
|
||||||
The `--type=LoadBalancer` flag indicates that you want to expose your Service outside of the cluster.
|
The `--type=LoadBalancer` flag indicates that you want to expose your Service outside of the cluster.
|
||||||
|
|
||||||
The application code inside the image `k8s.gcr.io/echoserver` only listens on TCP port 8080. If you used `kubectl expose` to expose a different port, clients could not connect to that other port.
|
|
||||||
|
|
||||||
View the Service you created:
|
View the Service you created:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|
Loading…
Reference in New Issue