Skip to content

Commit

Permalink
feat(helm): add networkPolicy for miw
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Lecheler <marco.lecheler@mercedes-benz.com>
  • Loading branch information
fty4 committed Jan 24, 2024
1 parent 834c390 commit 502b633
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
38 changes: 38 additions & 0 deletions charts/managed-identity-wallet/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# /********************************************************************************
# * Copyright (c) 2024 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License, Version 2.0 which is available at
# * https://www.apache.org/licenses/LICENSE-2.0.
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# * License for the specific language governing permissions and limitations
# * under the License.
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/
{{- if .Values.networkPolicy.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "managed-identity-wallet.fullname" . }}
labels:
{{- include "managed-identity-wallet.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "managed-identity-wallet.selectorLabels" . | nindent 6 }}
policyTypes:
- Ingress
ingress:
- from:
{{- toYaml .Values.networkPolicy.from | nindent 4 }}
ports:
- protocol: TCP
port: 8080
{{- end }}
7 changes: 7 additions & 0 deletions charts/managed-identity-wallet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ podAnnotations: {}
# -- add initContainers to the miw deployment
initContainers: []

networkPolicy:
# -- If `true` network policy will be created to restrict access to managed-identity-wallet
enabled: false
# -- Specify from rule network policy for miw (defaults to all namespaces)
from:
- namespaceSelector: {}

## @section Managed Identity Wallet Primary Parameters
##
miw:
Expand Down

0 comments on commit 502b633

Please sign in to comment.