Skip to content

Commit

Permalink
add proxy settings with Networkpolicie
Browse files Browse the repository at this point in the history
  • Loading branch information
eumel8 committed Oct 30, 2023
1 parent 6fdfbfe commit 9bbb247
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
secret.yaml
chart/charts/kepler
chart/s01.yaml
2 changes: 1 addition & 1 deletion chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ annotations:
catalog.cattle.io/display-name: CaaS Carbon Footprint
name: caas-carbon-footprint
description: A Helm chart for carbon footprint measurement
version: "0.0.3"
version: "0.0.4"
appVersion: "0.3"
keywords:
- monitoring
Expand Down
41 changes: 23 additions & 18 deletions chart/templates/entsoe-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
value: "{{ .Values.entsoe.end }}"
- name: entsoe_start
value: "{{ .Values.entsoe.start }}"
#- name: https_proxy
# value: "http://10.105.124.65:8084"
{{- if .Values.entsoe.proxy.enabled }}
- name: https_proxy
value: "{{ .Values.entsoe.proxy.protocol }}://{{ .Values.entsoe.proxy.host }}:{{ .Values.entsoe.proxy.port }}"
{{- end }}
resources:
{{- toYaml .Values.entsoe.resources | nindent 12 }}
securityContext:
Expand All @@ -61,21 +63,24 @@ spec:
- name: tmp
emptyDir:
medium: Memory
{{ if .Values.entsoe.proxy.enabled }}
---
#apiVersion: networking.k8s.io/v1
#kind: NetworkPolicy
#metadata:
# annotations:
# name: np-entsoe
#spec:
# egress:
# - ports:
# - port: 8084
# protocol: TCP
# to:
# - ipBlock:
# cidr: 10.105.124.65/32
# podSelector: {}
# policyTypes:
# - Egress
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: entsoe-{{ include "caas-carbon-footprint.fullname" . }}
spec:
egress:
- ports:
- port: {{ .Values.entsoe.proxy.port }}
protocol: TCP
to:
- ipBlock:
cidr: {{ .Values.entsoe.proxy.host }}/32
podSelector:
matchLabels:
{{- include "caas-carbon-footprint.selectorLabels" . | nindent 6 }}
policyTypes:
- Egress
{{ end }}
{{ end }}
15 changes: 11 additions & 4 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@ entsoe:
# apply for token here: https://transparency.entsoe.eu/content/static_content/download?path=/Static%20content/API-Token-Management.pdf
#entsoe_api_key:
image:
#repository: mtr.devops.telekom.de/caas/entsoe
#tag: latest
repository: ghcr.io/caas-team/entsoe
tag: 0.0.3
repository: mtr.devops.telekom.de/caas/entsoe
tag: 0.0.4
pullPolicy: Always
podSecurityContext:
fsGroup: 1000
supplementalGroups:
- 1000
# proxy settings for outside API requests to https://web-api.tp.entsoe.eu:443
proxy:
enabled: false
#host: 10.0.0.1
#port: 3128
#protocol: http
resources:
limits:
cpu: 200m
Expand All @@ -47,12 +51,15 @@ entsoe:
readOnlyRootFilesystem: true
runAsUser: 1000
runAsGroup: 1000
# beware of the API request limit
# sec. 1.8 https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html
serviceMonitor:
interval: 10m
# hours back when entsoe metrics should collected
# note: unfortunately no real time data for Germany, must be at least one day back
start: 25
end: 24
# install app in Rancher environment
# this will user Rancher defined namespaces and labels
rancher:
enabled: true

0 comments on commit 9bbb247

Please sign in to comment.