apiVersion: apps/v1
kind: Deployment
metadata:
name: my-dep
spec:
replicas: 3
selector:
matchLabels:
app: my-pod
template:
metadata:
labels:
app: my-pod
spec:
containers:
- name: my-con
image: nginx:latest
apiVersion: v1
kind: Pod
metadata:
name: testns-pod
namespace: test-ns
spec:
containers:
- name: testns-con
image: nginx
apiVersion: v1
kind: Namespace
metadata:
name: lunch
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: lunch-dep
namespace: lunch
spec:
replicas: 2
selector:
matchLabels:
app: lunch-pod-label
template:
metadata:
labels:
app: lunch-pod-label
spec:
containers:
- name: lunch-con
image: nginx:latest
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-dep
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: my-con
image: nginx:latest
apiVersion: v1
kind: Service
metadata:
name: svc-nginx
spec:
type: NodePort
selector:
app: nginx
ports:
- nodePort: 30001
port: 80
targetPort: 80
apiVersion: v1
kind: Namespace
metadata:
name: ip-ns
---
apiVersion: v1
kind: Service
metadata:
name: svc-ipnginx
namespace: ip-ns
spec:
type: NodePort
selector:
app: myipnginx
ports:
- nodePort: 32000
port: 80
targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ip-dep
namespace: ip-ns
spec:
replicas: 3
selector:
matchLabels:
app: myipnginx
template:
metadata:
name: my-httpd-pod
labels:
app: myipnginx
spec:
containers:
- name: ip-con
image: oolralra/ipnginx
apiVersion: v1
kind: Namespace
metadata:
name: tom-ns
---
apiVersion: v1
kind: Service
metadata:
name: svc-tom
namespace: tom-ns
spec:
type: NodePort
selector:
app: tom
ports:
- nodePort: 31000
port: 80
targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tom-dep
namespace: tom-ns
spec:
replicas: 3
selector:
matchLabels:
app: tom
template:
metadata:
name: tom-pod
labels:
app: tom
spec:
containers:
- name: tom-con
image: tomcat
{
"insecure-registries": ["61.254.18.30:5000"]
}
apiVersion: v1
kind: Service
metadata:
name: svc-myhttpd
spec:
type: NodePort
selector:
app: myhttpd
ports:
- nodePort: 32000
port: 80
targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: myhttpd-dep
spec:
replicas: 3
selector:
matchLabels:
app: myhttpd
template:
metadata:
name: myhttpd-pod
labels:
app: myhttpd
spec:
containers:
- name: myhttpd-con
image: 61.254.18.30:5000/pcm/httpd:1
cat <<EOF >> /etc/containerd/config.toml
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."61.254.18.30:5000"]
endpoint = ["http://61.254.18.30:5000"]
[plugins."io.containerd.grpc.v1.cri".registry.configs."61.254.18.30:5000".tls]
insecure_skip_verify = true
EOF
wget https://raw.githubusercontent.com/metallb/metallb/v0.14.5/config/manifests/metallb-native.yaml
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: first-pool
namespace: metallb-system
spec:
addresses:
- 211.183.3.200-211.183.3.240
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: example
namespace: metallb-system
https://kubernetes.github.io/ingress-nginx/deploy/#bare-metal-clusters
apiVersion: v1
kind: Service
metadata:
name: svc-myhttpd
spec:
selector:
app: myhttpd
ports:
- port: 80
targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: myhttpd-dep
spec:
replicas: 3
selector:
matchLabels:
app: myhttpd
template:
metadata:
name: myhttpd-pod
labels:
app: myhttpd
spec:
containers:
- name: myhttpd-con
image: 61.254.18.30:5000/pcm/httpd:1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: rapa.com
http:
paths:
- path: /httpd
pathType: Prefix
backend:
service:
name: svc-myhttpd
port:
number: 80
apiVersion: v1
kind: Service
metadata:
name: svc-mynginx
spec:
selector:
app: mynginx
ports:
- port: 80
targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mynginx-dep
spec:
replicas: 2
selector:
matchLabels:
app: mynginx
template:
metadata:
name: mynginx-pod
labels:
app: mynginx
spec:
containers:
- name: mynginx-con
image: public.ecr.aws/nginx/nginx:stable-perl
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: 2web
namespace: 2web-ns
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: aws5.com
http:
paths:
- path: /ip
pathType: Prefix
backend:
service:
name: svc-ip
port:
number: 80
- path: /h
pathType: Prefix
backend:
service:
name: svc-h
port:
number: 80
apiVersion: v1
kind: Service
metadata:
name: svc-ip
namespace: 2web-ns
spec:
selector:
app: ipnginx
ports:
- port: 80
targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ip-dep
namespace: 2web-ns
spec:
replicas: 2
selector:
matchLabels:
app: ipnginx
template:
metadata:
name: ip-pod
labels:
app: ipnginx
spec:
containers:
- name: ip-con
image: 61.254.18.30:5000/ipnginx:latest
'AWS Cloud School' 카테고리의 다른 글
[06.28] Kubernetes configMap, Secret, 3-tier-architecture (0) | 2024.07.04 |
---|---|
[06.27] Kubernetes PV, PVC (0) | 2024.06.27 |
[06.24] Kubernetes 기초(로컬 클러스터 구성) (0) | 2024.06.24 |
[06.17] AWS ECR, ECS (0) | 2024.06.22 |
[06.14] Docker Swarm (0) | 2024.06.16 |