Compare commits
5 Commits
82b4704f13
...
839104e6d8
Author | SHA1 | Date | |
---|---|---|---|
839104e6d8 | |||
dd0b70e779 | |||
1fb2dcf040 | |||
768935528b | |||
5188b5b65e |
@@ -17,7 +17,7 @@ system_info:
|
|||||||
|
|
||||||
runcmd:
|
runcmd:
|
||||||
- mkdir -p /home/ubuntu/.kube /home/ubuntu/.config/fish/completions
|
- mkdir -p /home/ubuntu/.kube /home/ubuntu/.config/fish/completions
|
||||||
- microk8s alias microk8s.kubectl kubectl
|
- snap alias microk8s.kubectl kubectl
|
||||||
- kubectl completion fish > /home/ubuntu/.config/fish/completions/kubectl.fish
|
- kubectl completion fish > /home/ubuntu/.config/fish/completions/kubectl.fish
|
||||||
- chown -R ubuntu:ubuntu /home/ubuntu/.kube /home/ubuntu/.config/fish
|
- chown -R ubuntu:ubuntu /home/ubuntu/.kube /home/ubuntu/.config/fish
|
||||||
- microk8s enable dns ingress dashboard helm helm3
|
- microk8s enable dns ingress dashboard helm helm3
|
@@ -1,11 +1,5 @@
|
|||||||
https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/
|
https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/
|
||||||
|
|
||||||
```kubectl create deployment web --image=gcr.io/google-samples/hello-app:1.0```
|
https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/
|
||||||
|
|
||||||
```kubectl create deployment web2 --image=gcr.io/google-samples/hello-app:2.0 --replicas=3```
|
```kubectl apply -f k8s/ingress```
|
||||||
|
|
||||||
```kubectl expose deployment web --type=NodePort --port=8080```
|
|
||||||
|
|
||||||
```kubectl expose deployment web2 --type=ClusterIP --port=8080```
|
|
||||||
|
|
||||||
```kubectl get service web```
|
|
||||||
|
19
ingress/web-deplyment.yaml
Normal file
19
ingress/web-deplyment.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: web
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
run: web
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
run: web
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: web
|
||||||
|
image: gcr.io/google-samples/hello-app:1.0
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
@@ -1,7 +1,7 @@
|
|||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: example-ingress
|
name: web-ingress
|
||||||
annotations:
|
annotations:
|
||||||
nginx.ingress.kubernetes.io/rewrite-target: /$1
|
nginx.ingress.kubernetes.io/rewrite-target: /$1
|
||||||
spec:
|
spec:
|
12
ingress/web-service.yaml
Normal file
12
ingress/web-service.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: web
|
||||||
|
labels:
|
||||||
|
run: web
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 8080
|
||||||
|
protocol: TCP
|
||||||
|
selector:
|
||||||
|
run: web
|
19
ingress/web2-deplyment.yaml
Normal file
19
ingress/web2-deplyment.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: web2
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
run: web2
|
||||||
|
replicas: 3
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
run: web2
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: web2
|
||||||
|
image: gcr.io/google-samples/hello-app:2.0
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
12
ingress/web2-service.yaml
Normal file
12
ingress/web2-service.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: web2
|
||||||
|
labels:
|
||||||
|
run: web2
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 8080
|
||||||
|
protocol: TCP
|
||||||
|
selector:
|
||||||
|
run: web2
|
Reference in New Issue
Block a user