This commit is contained in:
2024-02-20 17:15:27 +08:00
committed by huty
parent 6706e1a633
commit 34158042ad
1529 changed files with 177765 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
kubectl apply -f solution/deployment.yaml
kubectl port-forward deploy/whoami 8080:80
curl http://localhost:8080
> "I'm whoami-687976f48b-tkxp9 running on Linux 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019"
kubectl get pods -o custom-columns=NAME:metadata.name
> whoami-68bf776fd-s6sr9
kubectl exec deploy/whoami -- sh -c 'hostname'
> whoami-687976f48b-tkxp9

View File

@@ -0,0 +1,8 @@
apiVersion: v1
kind: Pod
metadata:
name: whoami-1
spec:
containers:
- name: web
image: kiamol/ch02-whoami

View File

@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: whoami
labels:
app: whoami
version: ch02
spec:
selector:
matchLabels:
app: whoami
version: ch02
template:
metadata:
labels:
app: whoami
version: ch02
spec:
containers:
- name: web
image: kiamol/ch02-whoami