Jump to content

Kubernetes: Difference between revisions

434 bytes added ,  19 February 2022
Line 386: Line 386:
     ports:
     ports:
       - port: 52395
       - port: 52395
</syntaxhighlight>
}}
==NetworkPolicy==
Network policies are used to limit ingress or egress to pods.<br>
{{hidden | Example network policy |
<syntaxhighlight lang="yaml">
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: access-rstudio
spec:
  podSelector:
    matchLabels:
      pod-label: rstudio-pod
  ingress:
    - from:
        - podSelector:
            matchLabels:
              rstudio-access: "true"
</syntaxhighlight>
</syntaxhighlight>
}}
}}