Public Information

This commit is contained in:
2025-01-24 16:18:47 +01:00
commit 0bd2038c86
449 changed files with 108655 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
{{- include "nplus.init" $ -}}
{{- if ( include "nplus.ingressEnabled" . ) }}
{{- include "nplus.ingress" (list . .component.fullName) | nindent 0 }}
{{- if .this.ui }}
- path: {{ .Values.ingress.contextPath }}
pathType: Prefix
backend:
service:
name: {{ .component.fullName }}
port:
name: {{ include "nplus.backendProtocol" . }}
{{- end }}
{{- else }}
# kind: ingress
# Not Generating any Ingress for {{ .component.fullName }} as
# Ingress = {{ .this.ingress }}
# Service = {{ .this.service }}
{{- end }}

View File

@@ -0,0 +1,46 @@
{{- include "nplus.init" $ -}}
{{- if ((.this.security).cni).createNetworkPolicy }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ .component.fullName }}
{{- if .this.utils.includeNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
spec:
podSelector:
matchLabels:
{{- include "nplus.selectorLabels" . | nindent 6 }}
ingress:
{{- if ( include "nplus.ingressEnabled" . ) }}
{{- include "nplus.networkpolicy.allowFromIngress" . | nindent 2 }}
{{- end }}
- from:
- ipBlock:
cidr: {{ ((.this.security).cni).adminIpRange | quote }}
{{- if ((.this.security).cni).excludeUnusedPorts }}
ports:
{{- include "nplus.defaultPolicyPorts" . | nindent 4 }}
{{- end }}
policyTypes:
- Egress
- Ingress
egress:
- ports:
# -- Possible K8s API
- protocol: TCP
port: 16443
# -- Possible K8s API
- protocol: TCP
port: 443
# -- Access DNS
- protocol: TCP
port: 53
# -- Access DNS
- protocol: UDP
port: 53
{{- end }}

View File

@@ -0,0 +1,2 @@
{{- include "nplus.init" $ -}}
{{- include "nplus.podDisruptionBudget" . -}}

View File

@@ -0,0 +1,60 @@
{{- include "nplus.init" $ -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .component.fullName }}-svc-account
{{- if .this.utils.includeNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "nplus.instanceLabels" . | nindent 4 }}
annotations:
{{- include "nplus.argoSharedResource" . | nindent 4 }}
{{- include "nplus.annotations" . | nindent 4 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ .component.fullName }}-role
{{- if .this.utils.includeNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "nplus.instanceLabels" . | nindent 4 }}
annotations:
{{- include "nplus.argoSharedResource" . | nindent 4 }}
{{- include "nplus.annotations" . | nindent 4 }}
rules:
- apiGroups: ["apps"]
resources: ["deployments", "statefulsets"]
verbs: ["get", "update", "patch", "list", "watch"]
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["get", "update", "patch", "list", "watch", "delete"]
- apiGroups: ["nplus.cloud"]
resources: ["components", "instances", "applications"]
verbs: ["get", "update", "patch", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ .component.fullName }}-role-binding
{{- if .this.utils.includeNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "nplus.instanceLabels" . | nindent 4 }}
annotations:
{{- include "nplus.argoSharedResource" . | nindent 4 }}
{{- include "nplus.annotations" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ .component.fullName }}-role
subjects:
- kind: ServiceAccount
name: {{ .component.fullName }}-svc-account

View File

@@ -0,0 +1,33 @@
{{- include "nplus.init" $ -}}
apiVersion: v1
kind: Service
metadata:
{{- if .this.utils.includeNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
name: {{ .component.fullName }}
labels:
{{- include "nplus.instanceLabels" . | nindent 4 }}
annotations:
{{- include "nplus.annotations" . | nindent 4 }}
{{- include "nplus.securityAnnotations" . | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
ports:
{{- if .this.ui }}
{{- include "nplus.defaultServicePorts" . | nindent 4 }}
{{- end }}
selector:
{{- if eq .this.service.selector "component" }}
{{- include "nplus.selectorLabels" . | nindent 4 }}
{{- else if eq .this.service.selector "type" }}
{{- include "nplus.selectorLabelsNc" . | nindent 4 }}
{{- else }}
{{- fail (printf "Unknown Service Selector Type: %s - must be component or type" .this.service.selector) }}
{{- end }}

View File

@@ -0,0 +1,72 @@
{{- include "nplus.init" $ -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .component.fullName }}
{{- if .this.utils.includeNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "nplus.instanceLabels" . | nindent 4 }}
annotations:
{{- include "nplus.annotations" . | nindent 4 }}
{{- include "nplus.securityAnnotations" . | nindent 4 }}
spec:
serviceName: {{ .component.fullName }}
selector:
matchLabels:
{{- include "nplus.selectorLabels" . | nindent 6 }}
replicas: 1
podManagementPolicy: OrderedReady
updateStrategy:
type: RollingUpdate
minReadySeconds: 30
template:
metadata:
labels:
{{- include "nplus.templateLabels" . | nindent 8 }}
annotations:
{{- include "nplus.templateAnnotations" . | nindent 8 }}
{{- include "nplus.securityAnnotations" . | nindent 8 }}
spec:
serviceAccountName: {{ .component.fullName }}-svc-account
{{- include "nplus.imagePullSecrets" . | nindent 6 }}
{{- include "nplus.podSecurityContext" . | nindent 6 }}
{{- include "nplus.securityIllumioReadinessGates" . | nindent 6 }}
{{- include "nplus.terminationGracePeriodSeconds" . | nindent 6 }}
containers:
- name: operator
image: {{ include "nplus.image" (dict "global" .Values.global "image" .Values.image) }}
imagePullPolicy: {{ include "nplus.imagePullPolicy" .Values.image }}
{{- include "nplus.containerSecurityContext" . | nindent 8 }}
{{- include "nplus.resources" . | nindent 8 }}
ports:
{{- include "nplus.defaultContainerPorts" . | nindent 8 }}
env:
- name: OP_PREFIX
value: "/monitoring"
{{- if .this.ui }}
- name: OP_UI
value: "true"
{{- end }}
# -- feel free to switch verbode loggin ON here:
# - name: OP_VERBOSE
# value: "true"
readinessProbe:
tcpSocket:
port: {{ include "nplus.backendPort" . }}
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
tcpSocket:
port: {{ include "nplus.backendPort" . }}
initialDelaySeconds: 10
periodSeconds: 10