Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
okd-apps
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marcones Silva
okd-apps
Commits
3126c757
Commit
3126c757
authored
Dec 01, 2021
by
Marcones Silva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Execicrio cap 5 network-policy, arquivo deployment
parent
2ebf57a0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
0 deletions
+63
-0
README.md
README.md
+4
-0
network-policy/allow-from-openshift-ingress.yaml
network-policy/allow-from-openshift-ingress.yaml
+11
-0
network-policy/allow-specific.yaml
network-policy/allow-specific.yaml
+19
-0
network-policy/deny-all.yaml
network-policy/deny-all.yaml
+5
-0
network-policy/display-project-info.sh
network-policy/display-project-info.sh
+24
-0
No files found.
README.md
View file @
3126c757
...
...
@@ -3,3 +3,7 @@
## Material de apoio ao curso Adminsitração OKD II.
Cada Branch corresponde a um exercicio pratico.
```
shell
git checkout network-policy
```
\ No newline at end of file
network-policy/allow-from-openshift-ingress.yaml
0 → 100644
View file @
3126c757
kind
:
NetworkPolicy
apiVersion
:
networking.k8s.io/v1
metadata
:
name
:
allow-from-openshift-ingress
spec
:
podSelector
:
CHANGE_ME
ingress
:
-
from
:
-
namespaceSelector
:
matchLabels
:
CHANGE_ME
network-policy/allow-specific.yaml
0 → 100644
View file @
3126c757
kind
:
NetworkPolicy
apiVersion
:
networking.k8s.io/v1
metadata
:
name
:
allow-specific
spec
:
podSelector
:
matchLabels
:
deployment
:
CHANGE_ME
ingress
:
-
from
:
-
namespaceSelector
:
matchLabels
:
name
:
CHANGE_ME
podSelector
:
matchLabels
:
deployment
:
CHANGE_ME
ports
:
-
port
:
CHANGE_ME
protocol
:
CHANGE_ME
network-policy/deny-all.yaml
0 → 100644
View file @
3126c757
kind
:
NetworkPolicy
apiVersion
:
networking.k8s.io/v1
metadata
:
name
:
deny-all
spec
:
network-policy/display-project-info.sh
0 → 100755
View file @
3126c757
#!/usr/bin/bash
if
oc get project
-o
jsonpath
=
'{.items[*].metadata.name}'
|
grep
-q
network-policy
then
echo
"==================================================================="
echo
"PROJECT: network-policy"
echo
oc get pods
-o
custom-columns
=
"POD NAME:.metadata.name,IP ADDRESS:.status.podIP"
-n
network-policy
echo
oc get svc
-o
custom-columns
=
"SERVICE NAME:.metadata.name,CLUSTER-IP:.spec.clusterIP"
-n
network-policy
echo
oc get route
-o
custom-columns
=
"ROUTE NAME:.metadata.name,HOSTNAME:.spec.host,PORT:.spec.port.targetPort"
-n
network-policy
echo
echo
"==================================================================="
fi
if
oc get project
-o
jsonpath
=
'{.items[*].metadata.name}'
|
grep
-q
network-test
then
echo
"PROJECT: network-test"
echo
oc get pods
-o
custom-columns
=
"POD NAME:.metadata.name"
-n
network-test
echo
echo
"==================================================================="
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment