Skip to content

done #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: skelkube
Choose a base branch
from
Open

done #107

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions kubedefs/appdeploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: vproapp
labels:
app: vproapp
spec:
replicas: 1
selector:
matchLabels:
app: vproapp
template:
metadata:
labels:
app: vproapp
spec:
containers:
- name: vproapp
image: vprocontainers/vprofileapp
imagePullPolicy: Always
ports:
- name: vproapp-port
containerPort: 8080
initContainers:
- name: init-vproapp
image: busybox
command: ['sh', '-c', "until nslookup vprodb.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done"]
- name: init-memcache
image: busybox
command: ['sh', '-c', "until nslookup vprocache01.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done"]
- name: init-rabbitmq
image: busybox
command: ['sh', '-c', "until nslookup vpromq01.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done"]


19 changes: 19 additions & 0 deletions kubedefs/appingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minimal-ingress
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
ingressClassName: nginx
rules:
- host: api.termms.click
http:
paths:
- path: /
pathType: prefix
backend:
service: vproapp
port:
number: 8080

14 changes: 14 additions & 0 deletions kubedefs/appservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: vproapp
spec:
selector:
app: vproapp
ports:
- port: 8080
targetPort: vproapp-port
protocol: TCP
type: ClusterIP


46 changes: 46 additions & 0 deletions kubedefs/dbdeploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: vprodb
labels:
app: vprodb
spec:
replicas: 1
selector:
matchLabels:
app: vprodb
template:
metadata:
labels:
app: vprodb
spec:
containers:
- name: vprodb
image: vprocontainers/vprofiledb
volumeMounts:
- mountPath: /var/lib/mysql
name: vprodb-db-data
ports:
- name: vprodb-port
containerPort: 3306
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: app-secret
key: db-pass
volumes:
- name: vprodb-db-data
PersistentVolumeClaim:
claimName: db-pv-claim
initContainers:
- name: busybox
image: busybox:latest
args: ["rm", "-rf", "/var/lib/mysql/lost+found"]
volumeMounts:
- name: vprodb-db-data
mountPath: /var/lib/mysql




16 changes: 16 additions & 0 deletions kubedefs/dbpvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: db-pv-claim
labels:
app: vprodb
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
storageClassName: default



12 changes: 12 additions & 0 deletions kubedefs/dbservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: vprodb
spec:
selector:
app: vprodb
ports:
- protocol: TCP
port: 80
targetPort: vprodb-port
type: ClusterIP
22 changes: 22 additions & 0 deletions kubedefs/mcdep.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: vpromc
labels:
app: vpromc
spec:
replicas: 1
selector:
matchLabels:
app: vpromc
template:
metadata:
labels:
app: vpromc
spec:
containers:
- name: vpromc
image: memcached
Ports:
- name: vpromc-port
containerPort: 11211
14 changes: 14 additions & 0 deletions kubedefs/mcservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: vprocache01
spec:
selector:
app: vpromc
ports:
- port: 11211
targetPort: vpromc
protocol: TCP
type: ClusterIP


30 changes: 30 additions & 0 deletions kubedefs/rmqdeploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: vprormq
labels:
app: vprormq
spec:
replicas: 1
selector:
matchLabels:
app: vprormq
template:
metadata:
labels:
app: vprormq
spec:
containers:
- name: vprormq
image: rabbitmq
ports:
- name: vprormq-port
containerPort: 5672
env:
- name: RABBITMQ_DEFAULT_USER
value: "guest"
- name: RABBITMQ_DEFAULT_PASSWORD
valueFrom:
secretKeyRef:
- name: app-secret
key: rmq-pass
14 changes: 14 additions & 0 deletions kubedefs/rmqservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: vpromq01
spec:
selector:
app: vprormq
ports:
- port: 5672
targetPort: vprormq-port
protocol: TCP
type: ClusterIP


8 changes: 8 additions & 0 deletions kubedefs/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: app-secret
type: Opaque
data:
db-pass: dnByb2RicGFzcw==
rmq-pass: Z3Vlc3Q=