zwischenstand
This commit is contained in:
@@ -42,3 +42,7 @@ services:
|
||||
- ./esentricar.sql:/docker-entrypoint-initdb.d/esentricar.sql
|
||||
volumes:
|
||||
postgres:
|
||||
|
||||
curl -i -X POST car.localhost/car \
|
||||
-H "Content-Type: application/json" \
|
||||
--data-binary "@car_2.json"
|
||||
@@ -0,0 +1,8 @@
|
||||
#mit dive kann ich ein Dockerfile Image debuggen
|
||||
|
||||
docker run --rm -it \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v "$(pwd)":"$(pwd)" \
|
||||
-w "$(pwd)" \
|
||||
-v "$HOME/.dive.yaml":"$HOME/.dive.yaml" \
|
||||
wagoodman/dive:latest build -t <some-tag> .
|
||||
@@ -29,3 +29,8 @@ ps fax
|
||||
7426 ? S 0:00 \_ nginx: worker process
|
||||
7427 ? S 0:00 \_ nginx: worker process
|
||||
7428 ? S 0:00 \_ nginx: worker process
|
||||
|
||||
|
||||
docker stats zeigt den verbrauch an.
|
||||
|
||||
docker context
|
||||
@@ -6,7 +6,7 @@ volume:
|
||||
|
||||
werden nicht die Inhalte kopiert.
|
||||
|
||||
Wichtige einstellung für die Netzwerkadapter !!
|
||||
Wichtige einstellung für die Netzwerkadapter
|
||||
<code>
|
||||
networks:
|
||||
default:
|
||||
|
||||
@@ -96,6 +96,7 @@ This command is used to fetch the real time events from the server.
|
||||
|
||||
$ docker events
|
||||
|
||||
docker events
|
||||
This command is used to manage the Plugins.
|
||||
|
||||
$ docker plugin
|
||||
|
||||
6
k3d/registries.yml
Normal file
6
k3d/registries.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
mirrors:
|
||||
docker.io:
|
||||
endpoint:
|
||||
- "http://192.168.1.246:5001"
|
||||
- "https://mirror.gcr.io"
|
||||
- "https://docker.io"
|
||||
15
k3d/whoami-pod.yaml
Normal file
15
k3d/whoami-pod.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
run: whoami
|
||||
name: whoami2
|
||||
spec:
|
||||
containers:
|
||||
- image: bee42/whoami:2.2.0
|
||||
name: whoami2
|
||||
resources: {}
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
status: {}
|
||||
20
k3d/whoami4-pod.yaml
Normal file
20
k3d/whoami4-pod.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
run: whoami
|
||||
name: whoami-box
|
||||
spec:
|
||||
containers:
|
||||
- image: bee42/whoami:2.2.0
|
||||
name: whoami
|
||||
resources: {}
|
||||
- image: busybox
|
||||
name: box
|
||||
args:
|
||||
- sleep
|
||||
- "45"
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Never
|
||||
status: {}
|
||||
76
k8s/install_k3d
Normal file
76
k8s/install_k3d
Normal file
@@ -0,0 +1,76 @@
|
||||
mkdir ~/k3d
|
||||
|
||||
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
|
||||
CLUSTER=cnbc
|
||||
IP4=$(/sbin/ip -o -4 addr list br2 | awk '{print $4}' | cut -d/ -f1)
|
||||
|
||||
# Get from TRAINER :)
|
||||
MIRROR_IP=192.168.1.246
|
||||
cat >registries.yml <<EOF
|
||||
mirrors:
|
||||
docker.io:
|
||||
endpoint:
|
||||
- "http://$MIRROR_IP:5001"
|
||||
- "https://mirror.gcr.io"
|
||||
- "https://docker.io"
|
||||
EOF
|
||||
|
||||
# WARNING Check IP
|
||||
k3d cluster create $CLUSTER \
|
||||
--api-port 8545 \
|
||||
-p "8580:80@loadbalancer" \
|
||||
-p "8543:443@loadbalancer" \
|
||||
--agents=2 \
|
||||
--k3s-arg "--tls-san=$IP4@server:0" \
|
||||
--k3s-arg "--disable=traefik@server:0" \
|
||||
--registry-create $CLUSTER-registry:0.0.0.0:5000 \
|
||||
--registry-config=./registries.yml
|
||||
echo | \
|
||||
openssl s_client -connect $IP4:8545 2>/dev/null | \
|
||||
openssl x509 -text
|
||||
|
||||
PORT=$(docker container inspect \
|
||||
--format '{{ (index (index .NetworkSettings.Ports "5000/tcp") 0).HostPort }}' \
|
||||
$CLUSTER-registry)
|
||||
sudo sh -c "echo 127.0.0.1 $CLUSTER-registry >>/etc/hosts"
|
||||
curl cnbc-registry:5000/v2/_catalog
|
||||
source <(k3d completion bash)
|
||||
|
||||
cloud:
|
||||
|
||||
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
|
||||
CLUSTER=cnbc
|
||||
# cloud instance
|
||||
IP4=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)
|
||||
|
||||
# WARNING Check IP
|
||||
k3d cluster create $CLUSTER \
|
||||
--api-port 8545 \
|
||||
-p "8580:80@loadbalancer" \
|
||||
-p "8543:443@loadbalancer" \
|
||||
--agents=2 \
|
||||
--k3s-arg "--tls-san=$IP4@server:0" \
|
||||
--k3s-arg "--disable=traefik@server:0" \
|
||||
--registry-create $CLUSTER-registry:0.0.0.0:5000
|
||||
|
||||
echo | \
|
||||
openssl s_client -connect $IP4:8545 2>/dev/null | \
|
||||
openssl x509 -text
|
||||
|
||||
PORT=$(docker container inspect \
|
||||
--format '{{ (index (index .NetworkSettings.Ports "5000/tcp") 0).HostPort }}' \
|
||||
$CLUSTER-registry)
|
||||
sudo sh -c "echo 127.0.0.1 $CLUSTER-registry >>/etc/hosts"
|
||||
curl cnbc-registry:5000/v2/_catalog
|
||||
source <(k3d completion bash)
|
||||
|
||||
sudo apt-get update && sudo apt-get install -y apt-transport-https
|
||||
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg \
|
||||
| sudo apt-key add -
|
||||
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" \
|
||||
| sudo tee -a /etc/apt/sources.list.d/kubernetes.list
|
||||
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y kubectl
|
||||
source <(kubectl completion bash)
|
||||
5
k8s/k8s_Object_Structure
Normal file
5
k8s/k8s_Object_Structure
Normal file
@@ -0,0 +1,5 @@
|
||||
API Version ---> die Verison
|
||||
Kind ---> Pod, Deployment, Quota, usw
|
||||
Metadaten ---> Namen, Namespache, usw
|
||||
Spec --->Desired state
|
||||
Status ---> Actual state
|
||||
16
k8s/pods
Normal file
16
k8s/pods
Normal file
@@ -0,0 +1,16 @@
|
||||
kubectl create namespace whoami
|
||||
kubectl config view
|
||||
kubectl config set-context --current --namespace whoami
|
||||
# create pod and service
|
||||
kubectl run whoami --image bee42/whoami:2.2.0 --expose --port 80
|
||||
kubectl get pods
|
||||
kubectl get pods -o yaml
|
||||
# see we created also a service!
|
||||
kubectl get svc
|
||||
|
||||
|
||||
kubectl run whoami --image bee42/whoami:2.2.0 --expose --port 80
|
||||
kubectl get pod whoami -o yaml
|
||||
|
||||
# kann zur erstellung der YAML genutzt werden.
|
||||
kubectl run whoami2 --image bee42/whoami:2.2.0 --labels=run=whoami --dry-run=client -o yaml >whoami-pod.yaml
|
||||
Reference in New Issue
Block a user