redhat-developer / redhat-developer/web-terminal-operator

Document / Implement web-terminal running in projects that have NetworkPolicies

Open
#90 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
42
Forks
24
Avg merge
3d 21h
Merged PRs (30d)
1

Description

If you deploy the default recommended set of NetworkPolicies (https://docs.openshift.com/container-platform/4.7/networking/network_policy/default-network-policy.html) you won't be able to get the web-terminal working in projects where such network policies apply.

Either you start the web terminal in a project where you do not have network policies (unlikely) or you must ensure, that you have a project that has the right network policies that allow access.

You can do this the following way:

oc label namespace openshift-console network.openshift.io/policy-group=console
cat >01_web_terminal.yaml<<EOF
apiVersion: v1
kind: Namespace
metadata:
  name: "my-web-terminal"
  labels:
    network.openshift.io/policy-group: web-terminal
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: web-terminal-operator 
  namespace: my-web-terminal
spec:
  channel: alpha
  installPlanApproval: Automatic
  name: web-terminal
  source: redhat-operators
  sourceNamespace: openshift-marketplace
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: web-terminal-operator
  namespace: my-web-terminal
spec:
  targetNamespaces: []
EOF
oc apply -f 01_web_terminal.yaml

cat >02_net_pols.yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-from-web-terminal
spec:
  ingress:
    -from:
      -namespaceSelector:
         matchLabels:
           network.openshift.io/policy-group:web-terminal
  podSelector:{}
  policyTypes:
    -Ingress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-from-console
spec:
  ingress:
    -from:
      -namespaceSelector:
         matchLabels:
           network.openshift.io/policy-group:console
  podSelector:{}
  policyTypes:
    -Ingress
EOF

in the project you like to get your web-terminal running, you'll need to add the additional network policies:

oc apply -f 02_net_pols.yaml

It would be nice if this is documented (e.g. official OCP docs) and if web-terminal also make it out of tech preview the following needs to happen:

  • webconsole project needs to get a net-pol label
  • operator must install into its own namespace with a label
  • document the additional net pols that are required

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the NetworkPolicy and operator-installation examples in the issue, then inspect the web-terminal operator and OpenShift Console namespace configuration. Done means the required namespace labels and policies are implemented where appropriate and the setup is documented for projects using the default NetworkPolicies.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes
Domain
devops, documentation, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.