GitBook: [master] one page modified

This commit is contained in:
CPol 2021-04-25 18:33:54 +00:00 committed by gitbook-bot
parent 8d521cb5b0
commit 59c7790f57
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF

View File

@ -98,6 +98,10 @@ kubelet: Running
apiserver: Running
kubeconfig: Configured
---- ONCE YOU HAVE A K8 SERVICE RUNNING WITH AN EXTERNAL SERVICE -----
$ minikube service mongo-express-service
(This will open your browser to access the service exposed port)
$ minikube delete
🔥 Deleting "minikube" in virtualbox ...
💀 Removed all traces of the "minikube" cluster
@ -145,7 +149,7 @@ Inside the specification of the deployment configuration file you can find the t
#### Example of Deployment + Service declared in the same configuration file \(from [here](https://gitlab.com/nanuchi/youtube-tutorial-series/-/blob/master/demo-kubernetes-components/mongo.yaml)\)
As a service usually is related to one deployment it's possible to declare both in the same configuration file:
As a service usually is related to one deployment it's possible to declare both in the same configuration file \(the service declared in this config is only accessible internally\):
```yaml
apiVersion: apps/v1
@ -194,6 +198,27 @@ spec:
targetPort: 27017
```
#### Example of external service config
This service will be accessible externally \(check the `nodePort` and `type: LoadBlancer` attributes\):
```yaml
---
apiVersion: v1
kind: Service
metadata:
name: mongo-express-service
spec:
selector:
app: mongo-express
type: LoadBalancer
ports:
- protocol: TCP
port: 8081
targetPort: 8081
nodePort: 30000
```
#### Example of secrets config file
Note how the password are encoded in B64 \(which isn't secure!\)