Skip to content

Commit 05962c9

Browse files
Merge pull request #1 from arashkaffamanesh/master
bind minikube with the practice environment
2 parents eaac0b8 + 85c97ab commit 05962c9

File tree

8 files changed

+82
-49
lines changed

8 files changed

+82
-49
lines changed

README.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,42 @@
1-
# cka-practice-environment
1+
# CKA Practice Environment
22

33
## Getting the environment up and ready
44

5-
Make sure that you have docker-compose installed([installation instructions](https://docs.docker.com/compose/install/)).
5+
- This repository is a fork of the original version by Arush Sal which was enhanced by Ankit Agrawal. <br>
6+
CREDITS goes to these awesome Kubernauts! <br>
7+
Origin: https://github.com/arush-sal/cka-practice-environment <br>
8+
Enhancement: https://github.com/aankittcoolest/cka-practice-environment
69

7-
To start the lab environment just run `docker-compose up -d` and point your browser at `localhost`
10+
- This fork focusses on binding minikube with the practice environment, which is based on GateOne Terminal.
811

12+
### STEPS
913

10-
Things to note:
11-
* The setup currently is in `Bring Your Own Cluster` state.
12-
* If your reload the `exam.html` it will reset the timer as the timer currently being used is jQuery based. - solution WIP
13-
* Since we are using jQuery to initialize and connect to GateOne therefore the application needs to be reachable from your browser host on port 8080. - solution WIP
14+
- Run minikube
15+
16+
```
17+
minikube start --vm-driver=virtualbox
18+
```
19+
20+
- Run script to adjust the keys locations
21+
22+
```
23+
sh script.sh
24+
```
25+
26+
- Boot up the instance (please adapt the user in the compose file)
27+
28+
```
29+
docker-compose up --build
30+
```
31+
32+
- Visit the test at following URL.
33+
34+
```
35+
http://localhost
36+
```
37+
38+
- Visit the terminal at following URL.
39+
40+
```
41+
http://localhost:8080
42+
```

docker-compose.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
version: '3.6'
22
services:
3-
gateone:
4-
image: arush/gateone:http
5-
ports:
6-
- "8080:8000"
7-
hostname: kubectl
8-
networks:
9-
- frontend
10-
volumes:
11-
- ssh_key:/root/.ssh/
12-
lab:
13-
image: arush/cka_lab
14-
ports:
15-
- "80:80"
16-
networks:
17-
- frontend
3+
gateone:
4+
build: ./gateone
5+
ports:
6+
- "8080:8000"
7+
hostname: kubectl
8+
networks:
9+
- frontend
10+
volumes:
11+
- ssh_key:/root/.ssh/
12+
- /Users/arash/.kube/:/root/.kube/
13+
- /Users/arash/.kube/keys:/root/.kube/keys
14+
lab:
15+
build: ./lab
16+
ports:
17+
- "80:80"
18+
networks:
19+
- frontend
1820
networks:
19-
frontend: {}
21+
frontend: {}
2022
volumes:
21-
ssh_key: {}
23+
ssh_key: {}

gateone/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM arush/gateone
1+
FROM kubernautslabs/gateone:latest
22
COPY conf.d/ /etc/gateone/conf.d/
33
RUN apt-get update && apt-get install wget curl vim openssh-client iputils-ping telnet nmap -y \
44
&& curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
55
&& chmod +x ./kubectl \
66
&& mv ./kubectl /usr/local/bin/kubectl \
7-
&& mkdir ~/.ssh && ssh-keygen -N "" -t rsa -f ~/.ssh/id_rsa \
7+
&& ssh-keygen -N "" -t rsa -f ~/.ssh/id_rsa \
88
&& cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys \
99
&& apt-get clean all

gateone/conf.d/ssh_config

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
1-
# This is the ssh client system-wide configuration file.
2-
See
3-
# ssh_config(5) for more information. This file provides
4-
defaults for
5-
# users, and the values can be changed in per-user config
6-
uration files
1+
# This is the ssh client system-wide configuration file. See
2+
# ssh_config(5) for more information. This file provides defaults for
3+
# users, and the values can be changed in per-user configuration files
74
# or on the command line.
85

96
# Configuration data is parsed as follows:
107
# 1. command line options
118
# 2. user-specific file
129
# 3. system-wide file
13-
# Any configuration value is only changed the first time
14-
it is set.
15-
# Thus, host-specific definitions should be at the beginn
16-
ing of the
10+
# Any configuration value is only changed the first time it is set.
11+
# Thus, host-specific definitions should be at the beginning of the
1712
# configuration file, and defaults at the end.
1813

19-
# Site-wide defaults for some commonly used options. For
20-
a comprehensive
21-
# list of available options, their meanings and defaults,
22-
please see the
14+
# Site-wide defaults for some commonly used options. For a comprehensive
15+
# list of available options, their meanings and defaults, please see the
2316
# ssh_config(5) man page.
2417

2518
Host *
@@ -47,10 +40,8 @@ Host *
4740
# Port 22
4841
# Protocol 2
4942
# Cipher 3des
50-
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,a
51-
rcfour128,aes128-cbc,3des-cbc
52-
# MACs hmac-md5,hmac-sha1,[email protected],hmac-ripe
53-
md160
43+
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
44+
# MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160
5445
# EscapeChar ~
5546
# Tunnel no
5647
# TunnelDevice any:any

lab/files/exam.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55
<meta charset="UTF-8">
6-
<title>Kubernauts</title>
6+
<title>Kubernauts Labs</title>
77
<link rel="stylesheet" href="css/bootstrap.min.css">
88
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
99
<link rel="stylesheet" href="css/bootstrap-select.min.css">
@@ -26,7 +26,7 @@
2626
<span class="icon-bar"></span>
2727
<span class="icon-bar"></span>
2828
</button>
29-
<a class="navbar-brand" href="https://kubernauts.io">Kubernauts</a>
29+
<a class="navbar-brand" href="https://kubernauts.de">Kubernauts</a>
3030
</div>
3131
<div id="navbar" class="collapse navbar-collapse">
3232
<ul class="nav navbar-nav">

lab/files/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5-
<title>Kubernauts</title>
5+
<title>Kubernauts Labs</title>
66
<link rel="stylesheet" href="css/bootstrap.min.css">
77
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
88
<script src="js/bootstrap.min.js" type="text/javascript"></script>
@@ -19,7 +19,7 @@
1919
<span class="icon-bar"></span>
2020
<span class="icon-bar"></span>
2121
</button>
22-
<a class="navbar-brand" href="https://kubernauts.io">Kubernauts</a>
22+
<a class="navbar-brand" href="https://kubernauts.de">Kubernauts</a>
2323
</div>
2424
<div id="navbar" class="collapse navbar-collapse">
2525
<ul class="nav navbar-nav">

lab/files/questions/2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h3>Q. Enable cluster auditing</h3>
22
<p>
3-
<li>Enable cluster wide auditing. You can use the audit policy provide at <a href="https://github.com/kubernetes/website/blob/master/content/en/docs/tasks/debug-application-cluster/audit-policy.yaml">here.</a></li>
3+
<li>Enable cluster wide auditing. You can use the audit policy provided <a href="https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/audit/audit-policy.yaml">here.</a></li>
44
<li>Make sure the audit logs are properly generated and saved to a log file.</li>
55
</p>

script.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
USERNAME=`id -un`
4+
cd ~/.kube
5+
mkdir -p keys
6+
cp /Users/${USERNAME}/.minikube/ca.crt keys/
7+
cp /Users/${USERNAME}/.minikube/profiles/minikube/client.crt keys/
8+
cp /Users/${USERNAME}/.minikube/profiles/minikube/client.key keys/
9+
10+
gsed -i "s/\/Users\/${USERNAME}\/.minikube\/profiles\/minikube/.\/keys/g" config
11+
gsed -i "s/\/Users\/${USERNAME}\/.minikube/.\/keys/g" config

0 commit comments

Comments
 (0)