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

NetworkPolicy: from should be an array of objects #2423

Merged
merged 2 commits into from
Sep 24, 2021

Conversation

Namanl2001
Copy link
Contributor

@Namanl2001 Namanl2001 commented Sep 21, 2021

Signed-off-by: Namanl2001 namanlakhwani@gmail.com

from in kyverno Helm Chart should be an array of objects instead of an object.
changes as per slack discussion: https://kubernetes.slack.com/archives/CLGR9BJU9/p1632167129427100

cc: @realshuting @antoineozenne @diranged

---
# Source: kyverno/templates/networkpolicy.yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  labels: 
    app.kubernetes.io/component: kyverno
    app.kubernetes.io/instance: RELEASE-NAME
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: kyverno
    app.kubernetes.io/part-of: kyverno
    app.kubernetes.io/version: "v2.0.4"
    helm.sh/chart: kyverno-v2.0.4
    app: kyverno
  name: RELEASE-NAME-kyverno
  namespace: default
spec:
  podSelector:
    matchLabels:
      app: kyverno
  policyTypes:
  - Ingress
  ingress:
  - from:
      - namespaceSelector:
          matchExpressions:
          - {}
          matchLabels:
        podSelector:
          matchExpressions:
          - {}
          matchLabels:
    ports:
    - protocol: TCP
      port: 9443 # webhook access
  # Allow prometheus scrapes for metrics
  - ports:
      - port: 8000

Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>
@realshuting
Copy link
Member

@Namanl2001 - thanks for the fix!

Can you please attach the proof manifest in the description? You can install a local Helm chart and custom this NetworkPolicy:

CHART REFERENCES

When you use a chart reference with a repo prefix ('example/mariadb'), Helm will look in the local configuration for a chart repository named 'example', and will then look for a chart in that repository whose name is 'mariadb'

Signed-off-by: Namanl2001 <namanlakhwani@gmail.com>
@realshuting realshuting self-assigned this Sep 23, 2021
@realshuting realshuting self-requested a review September 23, 2021 21:54
@realshuting realshuting added this to the Kyverno Release 1.5.0 milestone Sep 23, 2021
@realshuting realshuting added the milestone 1.5.0 Issues and PRs for the 1.5.0 release. label Sep 23, 2021
@realshuting realshuting merged commit 63f5c09 into kyverno:main Sep 24, 2021
@Namanl2001 Namanl2001 deleted the network-policy branch September 25, 2021 07:53
@pathikritmodak
Copy link

@realshuting can this helm chart version be released before 1.5.0 milestone?
The current one in master is broken on network policy.

@diranged
Copy link

@realshuting can this helm chart version be released before 1.5.0 milestone?
The current one in master is broken on network policy.

For what its worth - I strongly believe that Helm charts should be released on a very different (eg: immediate) cadence vs the applications they support.

@chipzoller
Copy link
Member

@realshuting can this helm chart version be released before 1.5.0 milestone?
The current one in master is broken on network policy.

For what its worth - I strongly believe that Helm charts should be released on a very different (eg: immediate) cadence vs the applications they support.

Agreed. There's no reason for a Helm chart to share the same cadence as the bits it represents if there are improvements to the experience.

@realshuting
Copy link
Member

@realshuting can this helm chart version be released before 1.5.0 milestone?
The current one in master is broken on network policy.

Yes we can, but the problem is that PR #2357 was merged before this fix. If we publish a new release, you will need to follow the new upgrade approach to upgrade Kyverno. If that's ok then I can tag a new Helm release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
milestone 1.5.0 Issues and PRs for the 1.5.0 release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants