133 lines
2.4 KiB
YAML
133 lines
2.4 KiB
YAML
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: dantegpu-production
|
|
labels:
|
|
name: dantegpu-production
|
|
environment: production
|
|
managed-by: kubernetes
|
|
---
|
|
apiVersion: v1
|
|
kind: ResourceQuota
|
|
metadata:
|
|
name: production-quota
|
|
namespace: dantegpu-production
|
|
spec:
|
|
hard:
|
|
requests.cpu: "100"
|
|
requests.memory: 200Gi
|
|
requests.storage: 1Ti
|
|
persistentvolumeclaims: "50"
|
|
pods: "200"
|
|
services: "50"
|
|
secrets: "100"
|
|
configmaps: "50"
|
|
---
|
|
apiVersion: v1
|
|
kind: LimitRange
|
|
metadata:
|
|
name: production-limits
|
|
namespace: dantegpu-production
|
|
spec:
|
|
limits:
|
|
- max:
|
|
cpu: "8"
|
|
memory: 16Gi
|
|
min:
|
|
cpu: 100m
|
|
memory: 128Mi
|
|
default:
|
|
cpu: "1"
|
|
memory: 1Gi
|
|
defaultRequest:
|
|
cpu: 500m
|
|
memory: 512Mi
|
|
type: Container
|
|
- max:
|
|
cpu: "16"
|
|
memory: 32Gi
|
|
min:
|
|
cpu: 100m
|
|
memory: 128Mi
|
|
type: Pod
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: default-deny-all
|
|
namespace: dantegpu-production
|
|
spec:
|
|
podSelector: {}
|
|
policyTypes:
|
|
- Ingress
|
|
- Egress
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: allow-same-namespace
|
|
namespace: dantegpu-production
|
|
spec:
|
|
podSelector: {}
|
|
policyTypes:
|
|
- Ingress
|
|
- Egress
|
|
ingress:
|
|
- from:
|
|
- podSelector: {}
|
|
egress:
|
|
- to:
|
|
- podSelector: {}
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: allow-dns
|
|
namespace: dantegpu-production
|
|
spec:
|
|
podSelector: {}
|
|
policyTypes:
|
|
- Egress
|
|
egress:
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
name: kube-system
|
|
ports:
|
|
- protocol: UDP
|
|
port: 53
|
|
---
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: dantegpu-service-account
|
|
namespace: dantegpu-production
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: Role
|
|
metadata:
|
|
name: dantegpu-role
|
|
namespace: dantegpu-production
|
|
rules:
|
|
- apiGroups: [""]
|
|
resources: ["pods", "services", "configmaps", "secrets"]
|
|
verbs: ["get", "list", "watch"]
|
|
- apiGroups: ["apps"]
|
|
resources: ["deployments", "statefulsets"]
|
|
verbs: ["get", "list", "watch"]
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: RoleBinding
|
|
metadata:
|
|
name: dantegpu-rolebinding
|
|
namespace: dantegpu-production
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: dantegpu-service-account
|
|
namespace: dantegpu-production
|
|
roleRef:
|
|
kind: Role
|
|
name: dantegpu-role
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|