Commit 59980e99 authored by Yuji Itadori's avatar Yuji Itadori

Add new file

parent a6c15fe8
apiVersion: v1
kind: Service
metadata:
name: $SERVICENAME
labels:
app: $SERVICENAME
namespace: go
spec:
ports:
- name: app
port: 80
protocol: TCP
targetPort: 80
selector:
app: $SERVICENAME
tier: frontend
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: $SERVICENAME-pv-claim
labels:
app: $SERVICENAME
namespace: go
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: $SERVICENAME
labels:
app: $SERVICENAME
namespace: go
spec:
selector:
matchLabels:
app: $SERVICENAME
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: $SERVICENAME
tier: frontend
spec:
containers:
- image: dockreg.vnetcloud.com/$SERVICENAME:ci-cd
name: $SERVICENAME
env:
- name: GO_DB_HOST
value: postgres-master
- name: GO_DB_PASSWORD
value: "postgres"
- name: GO_DB_USERNAME
value: "postgres"
- name: GO_DB_NAME
value: "$SERVICENAME"
ports:
- containerPort: 80
name: $SERVICENAME
volumeMounts:
- name: $SERVICENAME-persistent-storage
mountPath: /var/www/html
volumes:
- name: $SERVICENAME-persistent-storage
persistentVolumeClaim:
claimName: $SERVICENAME-pv-claim
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