Skip to content

Commit

Permalink
Homework 20
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasiliy Motchenko committed Mar 2, 2024
1 parent 416a1e5 commit 5e817f4
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 3 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# c0zak_infra
c0zak Infra repository

ДЗ 20

Основное ДЗ:
Всё сделано.

-------------------------

ДЗ 19

Основное ДЗ:
Expand Down
13 changes: 13 additions & 0 deletions kubernetes/reddit/mongo-claim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongo-pvc
spec:
storageClassName: ""
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 4Gi
volumeName: mongo-pv
3 changes: 2 additions & 1 deletion kubernetes/reddit/mongo-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ spec:
mountPath: /data/db
volumes:
- name: mongo-persistent-storage
emptyDir: {}
persistentVolumeClaim:
claimName: mongo-pvc
24 changes: 24 additions & 0 deletions kubernetes/reddit/mongo-network-policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-db-traffic
labels:
app: reddit
spec:
podSelector:
matchLabels:
app: reddit
component: mongo
policyTypes:
- Ingress
ingress:
- from:
- podSelector:
matchLabels:
app: reddit
component: comment
- podSelector:
matchLabels:
app: reddit
component: post
14 changes: 14 additions & 0 deletions kubernetes/reddit/mongo-volume.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: mongo-pv
spec:
capacity:
storage: 4Gi
accessModes:
- ReadWriteOnce
csi:
driver: disk-csi-driver.mks.ycloud.io
fsType: ext4
volumeHandle: fhmaa6j8o6aul1p9tuqb
19 changes: 19 additions & 0 deletions kubernetes/reddit/tls.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDEzCCAfugAwIBAgIUV8Z9DuInPCTHWqm0HZPqbUwEpYEwDQYJKoZIhvcNAQEL
BQAwGTEXMBUGA1UEAwwOMTU4LjE2MC4xMzYuMTcwHhcNMjQwMzAyMTIwMjQzWhcN
MjUwMzAyMTIwMjQzWjAZMRcwFQYDVQQDDA4xNTguMTYwLjEzNi4xNzCCASIwDQYJ
KoZIhvcNAQEBBQADggEPADCCAQoCggEBALCvVqp967CJKncTqrms0a1HAXqdO9cD
anQPmhOuaQOrNN3CwYzbPgUmDGQE7lXAXIV1cWKZfO8JHwni63MGg6azxS0KN6bX
FmhgTUqtaBJEJ7OVGJqGTRPJ4tnODRQjMK+UxKm9Eew1QhEYRrugzfqAw6EP+E0S
jlz+zFID1yuK088sY7NlsRXRl/OpK+qkDBZJDJwM7RSIIkohw7DH3p2tViNGl0GT
J/OQOtRpfNDbsbGharabUmDy+Z3JqM946LLprTUwgJE7M55bQH/Vne23L4FYN0qQ
FQgc67yAFS9tObL/YVsB0mX7hOCBS0i5s3FDueNewscmUlru0UmtykUCAwEAAaNT
MFEwHQYDVR0OBBYEFAkpQBzvZmlygGV7BbxOi7lPnXhIMB8GA1UdIwQYMBaAFAkp
QBzvZmlygGV7BbxOi7lPnXhIMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL
BQADggEBAK4AFOdzm/vqfje+4ztZwCfJJnMFT8n/CgiFUCye+g2AYzUyXjP0tZjb
oA8diVmZWkC7CJSUollytwT26NNNOeDlL7KNQdKKLTaSGl9FE4v8gExEjXTw8fHf
bC7g03r6jX9PaZ9s3CijhENRh+lfu8eRZxEtjEk4SbhqrDGC26ziLET2O6gKZ9L5
nAtFFNJoco9qav0Ibl2P4m87dfMco2pHaobrgklQCVNU7/5tiTGwZv2o5HzGh4yH
o2zhVF6fKt7/xSck4Y6cWWtB+SDS8Ug4yMcc5sYl0MS8iPJ/xcEOt4ekHiIqbM4G
gMvRwZXJjRvo5Gla3EGcWxLbJRrAJmg=
-----END CERTIFICATE-----
28 changes: 28 additions & 0 deletions kubernetes/reddit/tls.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCwr1aqfeuwiSp3
E6q5rNGtRwF6nTvXA2p0D5oTrmkDqzTdwsGM2z4FJgxkBO5VwFyFdXFimXzvCR8J
4utzBoOms8UtCjem1xZoYE1KrWgSRCezlRiahk0TyeLZzg0UIzCvlMSpvRHsNUIR
GEa7oM36gMOhD/hNEo5c/sxSA9critPPLGOzZbEV0ZfzqSvqpAwWSQycDO0UiCJK
IcOwx96drVYjRpdBkyfzkDrUaXzQ27GxoWq2m1Jg8vmdyajPeOiy6a01MICROzOe
W0B/1Z3tty+BWDdKkBUIHOu8gBUvbTmy/2FbAdJl+4TggUtIubNxQ7njXsLHJlJa
7tFJrcpFAgMBAAECggEANVu+gJ6mnxnNiUiXNpvKdtoKyEzT1YtiisprbaYucL0z
qgU3DqLniAaFl28lyx/c0TE2nOBdqpLGnOW61XISMDX6Ri/fvrMWQU9UCEl2NI4A
r2tHkuMcQ+2kZMKlkH9QJLZ47gn7b6pl2WPLeL6Hdi+M5Qc9pYkFFXCdo+clBDDX
UGMEOIA98iePKton6l/4MLor4UlvrNxDQJx+dP1ERPgIszhiOdXrJ52ObktqD1m2
HkL/e1Gy+n4u713vTCyODyzHMiN8+F06MlRYl7DY/BKabTIHmvt5UuDl6Cqz7h+z
NwXaNvbOdl4eOvjR/x2f+qLbBSmZrUy5Qg3sDeWxwQKBgQDyz92Nauy2chyxJObM
yPQD9XSIPCND1BAvOE8dlmG5xVZX2kG3OEYagomvUGPFndflvz/z1TULhj8wEbLY
zJU3VgdK+xvWy0VNJoZWbqTyQTknZzrNQpS2pKVtmlqFDMTa4rWwjBkIhEwodNkh
jGTezfcZQkMA0UdBZOxmkMK/twKBgQC6SAWELla/oIf50OpHEQeKFdTElq+zuZaT
tH2afp6Fq3qehxc5ND3hZH7pu5Ct9EJutxMPAx4Si2yuQt5U82vxKMySQPqZRU+v
N7IBTAym9CemAlx4+GuwJ/ByOEhhqfUh4fftsYJG6tXLb7RplM7xthhm/i1dFd29
Xjh0tcqN4wKBgC9nq86fUIWyM63WEYVrulBHjK/IZe4pKdu+N5wELyIwx9GxF+Fo
iC9GyxDCNihvz6XYN+kn+Ao+9HkzC2LOVleOYTAfZGkEGIyed93KDkQJvdnWiqFm
XVhnPrDuULvnKUu+tVA5me2SvrerUHT/TvY86gAxcplnQm0fAhRoMM1zAoGBAIPX
VZAn+93EkHiPFEEYHG3u5Zf9zn01bQ09QWiHFUsmArMQia9C+kj8B5cF2XBE4H/b
svF9E1ussk7jpNgbMNqONbuNoc+47pzknmesm4fOZgFoymoT6KPUoKk2jIQS9hv1
ArSIXdwzeP1zIg1X9N++MaczXofzYe0VMn/n6mRhAoGBAJ38+QykeVPjyxW8c9GK
zxwYw8pjJ/O8JLfqsGhU/WoAzo1Hfg5kYvpg/V5s7TbU75ZxUCDWQwvAA/fUSums
zGJjubLFTvOU0o/Wq11Hnxc3v+SW3lqrQEGcoU7N28aUtgxCJw66t6cKC982Iky8
DTJ0JuVz/vLHyxBijRq2cWom
-----END PRIVATE KEY-----
24 changes: 24 additions & 0 deletions kubernetes/reddit/ui-ingress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ui
labels:
app: reddit
component: ui
annotations:
kubernetes.io/ingress.class: "nginx"
kubernetes.io/ingress.allow-http: "false"
spec:
tls:
- secretName: ui-ingress
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: ui
port:
number: 9292
3 changes: 1 addition & 2 deletions kubernetes/reddit/ui-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ metadata:
spec:
type: NodePort
ports:
- nodePort: 32092
port: 9292
- port: 9292
protocol: TCP
targetPort: 9292
selector:
Expand Down

0 comments on commit 5e817f4

Please sign in to comment.