Compare commits
5 Commits
82b4704f13
...
839104e6d8
Author | SHA1 | Date |
---|---|---|
Jimmy | 839104e6d8 | |
Jimmy | dd0b70e779 | |
Jimmy | 1fb2dcf040 | |
Jimmy | 768935528b | |
Jimmy | 5188b5b65e |
|
@ -17,7 +17,7 @@ system_info:
|
|||
|
||||
runcmd:
|
||||
- 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
|
||||
- chown -R ubuntu:ubuntu /home/ubuntu/.kube /home/ubuntu/.config/fish
|
||||
- microk8s enable dns ingress dashboard helm helm3
|
|
@ -1,11 +1,5 @@
|
|||
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 expose deployment web --type=NodePort --port=8080```
|
||||
|
||||
```kubectl expose deployment web2 --type=ClusterIP --port=8080```
|
||||
|
||||
```kubectl get service web```
|
||||
```kubectl apply -f k8s/ingress```
|
||||
|
|
|
@ -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
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: example-ingress
|
||||
name: web-ingress
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /$1
|
||||
spec:
|
|
@ -0,0 +1,12 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: web
|
||||
labels:
|
||||
run: web
|
||||
spec:
|
||||
ports:
|
||||
- port: 8080
|
||||
protocol: TCP
|
||||
selector:
|
||||
run: web
|
|
@ -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
|
|
@ -0,0 +1,12 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: web2
|
||||
labels:
|
||||
run: web2
|
||||
spec:
|
||||
ports:
|
||||
- port: 8080
|
||||
protocol: TCP
|
||||
selector:
|
||||
run: web2
|
Loading…
Reference in New Issue