Initial commit

parents
apiVersion: v1
kind: Pod
metadata:
name: backend
labels:
app: backend
spec:
containers:
- name: backend
image: 192.168.56.200:5000/training_backend
ports:
- containerPort: 8080
apiVersion: v1
kind: Service
metadata:
name: backend
spec:
selector:
app: backend
ports:
- protocol: TCP
port: 8080
targetPort: 8080
\ No newline at end of file
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: backend-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: farm.192.168.56.100.xip.io
http:
paths:
- path: /
backend:
serviceName: backend
servicePort: 8080
- host: farm.192.168.56.11.xip.io
http:
paths:
- path: /
backend:
serviceName: backend
servicePort: 8080
- host: farm.192.168.56.12.xip.io
http:
paths:
- path: /
backend:
serviceName: backend
servicePort: 8080
- host: farm.192.168.56.13.xip.io
http:
paths:
- path: /
backend:
serviceName: backend
servicePort: 8080
- host: farm.192.168.56.240.xip.io
http:
paths:
- path: /
backend:
serviceName: backend
servicePort: 8080
- host: farm.192.168.56.241.xip.io
http:
paths:
- path: /
backend:
serviceName: backend
servicePort: 8080
- host: farm.192.168.56.242.xip.io
http:
paths:
- path: /
backend:
serviceName: backend
servicePort: 8080
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: backend-loadbalancer
spec:
selector:
app: backend
type: LoadBalancer
externalIPs:
- 192.168.56.201
ports:
- name: http
protocol: TCP
port: 8080
targetPort: 8080
apiVersion: v1
kind: Service
metadata:
name: backend-nodeport
spec:
selector:
app: backend
type: NodePort
ports:
- name: http
protocol: TCP
port: 8080
targetPort: 8080
nodePort: 30000
\ No newline at end of file
apiVersion: v1
kind: Pod
metadata:
name: ia
labels:
app: ia
spec:
containers:
- name: ia
image: 192.168.56.200:5000/training_ia
ports:
- containerPort: 8080
apiVersion: v1
kind: Service
metadata:
name: ia
spec:
selector:
app: ia
ports:
- protocol: TCP
port: 8080
targetPort: 8080
\ No newline at end of file
apiVersion: v1
kind: ConfigMap
metadata:
namespace: default
name: metallb-config
data:
config: |
address-pools:
- name: default
protocol: layer2
addresses:
- 192.168.56.240-192.168.56.250
# - 192.168.56.240/28
apiVersion: v1
kind: Pod
metadata:
name: mysql
labels:
app: mysql
spec:
containers:
- name: mysql
image: 192.168.56.200:5000/training_mysql
env:
- name: MYSQL_ALLOW_EMPTY_PASSWORD
value: "yes"
ports:
- containerPort: 3306
apiVersion: v1
kind: Pod
metadata:
name: mysql
labels:
app: mysql
spec:
containers:
- name: mysql
image: 192.168.56.200:5000/training_mysql
env:
- name: MYSQL_ALLOW_EMPTY_PASSWORD
value: "yes"
ports:
- containerPort: 3306
volumeMounts:
- mountPath: /var/lib/mysql
name: mysql-volume
volumes:
- name: mysql-volume
persistentVolumeClaim:
claimName: local-claim
\ No newline at end of file
apiVersion: v1
kind: Pod
metadata:
name: mysql
labels:
app: mysql
spec:
containers:
- name: mysql
image: 192.168.56.200:5000/training_mysql
env:
- name: MYSQL_ALLOW_EMPTY_PASSWORD
value: "yes"
ports:
- containerPort: 3306
volumeMounts:
- mountPath: /var/lib/mysql
name: mysql-volume
volumes:
- name: mysql-volume
emptyDir: {}
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: mysql
spec:
selector:
app: mysql
ports:
- protocol: TCP
port: 3306
targetPort: 3306
\ No newline at end of file
apiVersion: v1
kind: PersistentVolume
metadata:
name: local-pv
spec:
capacity:
storage: 20Mi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /mnt
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- k8s3
\ No newline at end of file
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: local-claim
spec:
storageClassName: local-storage
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 20Mi
apiVersion: v1
kind: Pod
metadata:
name: test00
spec:
containers:
- name: test00
image: 192.168.56.200:5000/training_test00
apiVersion: v1
kind: Pod
metadata:
name: test00
spec:
containers:
- name: test00
image: 192.168.56.200:5000/training_test00
restartPolicy: Never
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment