This shows you the differences between two versions of the page.
|
cc:laboratoare:06 [2021/11/22 13:08] alexandru.hogea [Ce urmeaza?] |
cc:laboratoare:06 [2021/11/22 13:20] (current) alexandru.hogea [Deployment-ul aplicatiei de laborator folosind YAML] |
||
|---|---|---|---|
| Line 246: | Line 246: | ||
| run: api #select the pod/pods | run: api #select the pod/pods | ||
| type: NodePort | type: NodePort | ||
| + | </code> | ||
| + | |||
| + | === Tips & Tricks === | ||
| + | <note tip> Puteti sa rulati toate configuratiile de yaml daca sunt puse impreuna intr-un folder, folosind ''kubectl apply -R -f NumeFolder''</note> | ||
| + | {{:cc:laboratoare:structurafolder.png|}} | ||
| + | <code bash> | ||
| + | kubectl apply -R -f .\Deployment\ | ||
| + | </code> | ||
| + | <note tip> | ||
| + | Puteti sa scrieti mai multe definitii in acelasi fisier YAML, daca separati definitiile prin **-****-****-** | ||
| + | </note> | ||
| + | <code yaml> | ||
| + | apiVersion: v1 | ||
| + | kind: Pod | ||
| + | metadata: | ||
| + | name: db | ||
| + | labels: | ||
| + | tip: gigica | ||
| + | spec: | ||
| + | containers: | ||
| + | - image: axonedge/lab-k8s-database | ||
| + | name: db | ||
| + | env: | ||
| + | - name: POSTGRES_USER | ||
| + | value: student | ||
| + | - name: POSTGRES_PASSWORD | ||
| + | value: student | ||
| + | - name: POSTGRES_DB | ||
| + | value: library | ||
| + | --- | ||
| + | apiVersion: v1 | ||
| + | kind: Service | ||
| + | metadata: | ||
| + | name: db-clusterip-service | ||
| + | spec: | ||
| + | selector: | ||
| + | tip: gigica | ||
| + | ports: | ||
| + | - port: 5432 | ||
| + | targetPort: 5432 | ||
| + | type: ClusterIP | ||
| </code> | </code> | ||
| ==== Ce urmeaza? ==== | ==== Ce urmeaza? ==== | ||