Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segregate kibana index network policy #2025

Merged
merged 4 commits into from
Oct 13, 2023

Conversation

pgvishnuram
Copy link
Contributor

@pgvishnuram pgvishnuram commented Oct 13, 2023

Description

Add seperate network policy within kibana network policy template this fixes an odd behaviour when authsidecar is enabled

Related Issues

https://github.com/astronomer/issues/issues/5912

Testing

QA should able to validate kibana index pattern creation with authsidecar enabled

Merging

cherry-pick to release-0.33

@pgvishnuram pgvishnuram marked this pull request as ready for review October 13, 2023 15:28
@pgvishnuram pgvishnuram requested a review from a team as a code owner October 13, 2023 15:28
@pgvishnuram
Copy link
Contributor Author

@danielhoherd

port: {{ .Values.ports.http }}
{{- end}}
{{ if .Values.createDefaultIndex }}
- from:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? We're adding a completely new from block to go along with the old one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old block was:

  ingress:
  - from:
    - podSelector:
        matchLabels:
          tier: nginx
          component: ingress-controller
          release: release-name

    - podSelector:
        matchLabels:
          component: kibana-default-index
          release: release-name
          tier: logging
    ports:
    - protocol: TCP
      port: 5601

The new block is

  ingress:
  - from:
    - podSelector:
        matchLabels:
          tier: nginx
          component: ingress-controller
          release: release-name
    ports:
    - protocol: TCP
      port: 5601

  - from:
    - podSelector:
        matchLabels:
          component: kibana-default-index
          release: release-name
          tier: logging
    ports:
    - protocol: TCP
      port: 5601

Is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to add a new from: when createDefaultIndex is enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with current code without authsidecar

  ingress:
  - from:
    - podSelector:
        matchLabels:
          tier: nginx
          component: ingress-controller
          release: astronomer
    
    - podSelector:
        matchLabels:
          component: kibana-default-index
          release: astronomer
          tier: logging
    ports:
    - protocol: TCP
      port: 5601

with current code with authsidecar it will fail since the port is using 8084 and requires houston authorization

  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          network.openshift.io/policy-group: ingress
    
    - podSelector:
        matchLabels:
          component: kibana-default-index
          release: astronomer
          tier: logging
    ports:
    - protocol: TCP
      port: 8084

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our new logic is to segregate the ingress and put a seperate rule to handle that case

Copy link
Member

@danielhoherd danielhoherd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pgvishnuram pgvishnuram merged commit 687b379 into master Oct 13, 2023
7 of 8 checks passed
@pgvishnuram pgvishnuram deleted the fix-kibana-index-network-policy branch October 13, 2023 18:06
pgvishnuram added a commit that referenced this pull request Oct 13, 2023
* segregate kibana index network policy

* update network policy for kibana index pattern

* fix kibana policy tests

* fix authsidecar tests
pgvishnuram added a commit that referenced this pull request Oct 18, 2023
* segregate kibana index network policy

* update network policy for kibana index pattern

* fix kibana policy tests

* fix authsidecar tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants