Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| en:modul:m321_aws:topics:08 [2025/10/22 15:53] – dgaravaldi | en:modul:m321_aws:topics:08 [2025/10/22 16:32] (aktuell) – dgaravaldi | ||
|---|---|---|---|
| Zeile 21: | Zeile 21: | ||
| It's recommend using YAML as the format for these declarations. You could use JSON, but YAML allows you __to add comments into the declarations__, | It's recommend using YAML as the format for these declarations. You could use JSON, but YAML allows you __to add comments into the declarations__, | ||
| + | \\ | ||
| ==== Example 1: Deployment-Elements in YAML explained ==== | ==== Example 1: Deployment-Elements in YAML explained ==== | ||
| < | < | ||
| Zeile 45: | Zeile 45: | ||
| ports: | ports: | ||
| - containerPort: | - containerPort: | ||
| - | |||
| </ | </ | ||
| + | |||
| + | |||
| In this YAML configuration, | In this YAML configuration, | ||
| \\ | \\ | ||
| Zeile 79: | Zeile 80: | ||
| $ kubectl logs pods/ | $ kubectl logs pods/ | ||
| </ | </ | ||
| - | |||
| \\ | \\ | ||
| Zeile 145: | Zeile 145: | ||
| targetPort: 8080 | targetPort: 8080 | ||
| type: ClusterIP | type: ClusterIP | ||
| + | </ | ||
| + | \\ | ||
| + | \\ | ||
| + | ===== Service types ===== | ||
| + | As a recapture on how your application can be accessed from the outside, we need to start with the types of Kubernetes Services. You can use four different service types, as follows: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | While LoadBalancer seems to be the simplest solution, it has two drawbacks: | ||
| + | * It's not always available, for example, if you're using minikube. | ||
| + | * External public IPs are usually expensive. A different solution is to use a '' | ||
| + | |||
| + | < | ||
| + | $ kubectl get service my-python-service | ||
| + | NAME | ||
| + | my-python-service | ||
| + | </ | ||
| + | |||
| + | You can see that port '' | ||
| + | |||
| + | The IP address of your Kubernetes node depends on your installation. In the case of minikube, you can check it with the minikube ip command: | ||
| + | |||
| + | < | ||
| + | $ kubectl get nodes -o jsonpath=' | ||
| + | 35.192.180.252 35.232.125.195 104.198.131.248 | ||
| + | </ | ||
| + | To check that you can access '' | ||
| + | |||
| + | < | ||
| + | $ curl http://< | ||
| </ | </ | ||