Skip to content

Commit

Permalink
Create nginx-example.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
phong2tran authored Jun 9, 2022
1 parent 7f1778b commit ea9fd41
Showing 1 changed file with 94 additions and 0 deletions.
94 changes: 94 additions & 0 deletions bases/nginx/nginx-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Copyright 2017 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: nginx-logs
namespace: paas-apps
labels:
app: nginx
spec:
# Optional:
# storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-example
namespace: paas-apps
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
# annotations:
# pre.hook.backup.velero.io/container: fsfreeze
# pre.hook.backup.velero.io/command: '["/sbin/fsfreeze", "--freeze", "/var/log/nginx"]'
# post.hook.backup.velero.io/container: fsfreeze
# post.hook.backup.velero.io/command: '["/sbin/fsfreeze", "--unfreeze", "/var/log/nginx"]'
spec:
volumes:
- name: nginx-logs
persistentVolumeClaim:
claimName: nginx-logs
containers:
- image: artifactory.otxlab.net/ot2-paas/nginx:latest
name: nginx
ports:
- containerPort: 80
volumeMounts:
- mountPath: "/var/log/nginx"
name: nginx-logs
readOnly: false
- image: artifactory.otxlab.net/ot2-paas/ubuntu/ubuntu:bionic
name: fsfreeze
securityContext:
privileged: true
volumeMounts:
- mountPath: "/var/log/nginx"
name: nginx-logs
readOnly: false
command:
- "/bin/bash"
- "-c"
- "sleep infinity"


---
apiVersion: v1
kind: Service
metadata:
labels:
app: nginx
name: my-nginx
namespace: paas-apps
spec:
ports:
- port: 80
targetPort: 80
selector:
app: nginx
type: LoadBalancer

0 comments on commit ea9fd41

Please sign in to comment.