-
-
Save AlexRogalskiy/2ffbdadab31d583b7525a770026a89ec to your computer and use it in GitHub Desktop.
Kubernetes first elements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: myapp | |
| labels: | |
| app: myapp | |
| spec: | |
| replicas: 3 | |
| template: | |
| metadata: | |
| labels: | |
| app: myapp | |
| spec: | |
| containers: | |
| - name: nginx | |
| image: nginx:1.17.8 | |
| ports: | |
| - containerPort: 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: networking.k8s.io/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: myapp | |
| annotations: | |
| # cloud-specific annotations may be necessary | |
| spec: | |
| rules: | |
| - host: my.example.com | |
| http: | |
| paths: | |
| - path: / | |
| backend: | |
| serviceName: myapp | |
| servicePort: 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| name: myapp | |
| labels: | |
| app: myapp | |
| spec: | |
| containers: | |
| - name: nginx | |
| image: nginx:1.17.8 | |
| ports: | |
| - containerPort: 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: myapp | |
| labels: | |
| app: myapp | |
| spec: | |
| selector: | |
| app: myapp | |
| type: NodePort | |
| ports: | |
| - port: 80 | |
| targetPort: 80 | |
| protocol: TCP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment