Timo Geier
4 years ago
3 changed files with 92 additions and 3 deletions
-
59kubernetes-example/kubectl-intro.md
-
20kubernetes-example/nginx.yml
-
16kubernetes-example/service.yml
@ -0,0 +1,20 @@ |
|||
apiVersion: apps/v1 |
|||
kind: Deployment |
|||
metadata: |
|||
name: nginx-deployment |
|||
namespace: web-test |
|||
spec: |
|||
selector: |
|||
matchLabels: |
|||
app: nginx-deployment |
|||
replicas: 3 # tells deployment to run 3 pods matching the template |
|||
template: |
|||
metadata: |
|||
labels: |
|||
app: nginx-deployment |
|||
spec: |
|||
containers: |
|||
- name: nginx |
|||
image: nginx:latest |
|||
ports: |
|||
- containerPort: 80 |
@ -0,0 +1,16 @@ |
|||
apiVersion: v1 |
|||
kind: Service |
|||
metadata: |
|||
name: nginx-service |
|||
namespace: web-test |
|||
spec: |
|||
type: NodePort |
|||
selector: |
|||
app: nginx-deployment |
|||
ports: |
|||
# By default and for convenience, the `targetPort` is set to the same value as the `port` field. |
|||
- port: 80 |
|||
targetPort: 80 |
|||
# Optional field |
|||
# By default and for convenience, the Kubernetes control plane will allocate a port from a range (default: 30000-32767) |
|||
nodePort: 30007 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue