Compare commits
No commits in common. "e60d280be2d6feace0ed70959bbc82e8738c8f72" and "c9b7f9f024eef12d9963a2fb5184f7e2ee4265a2" have entirely different histories.
e60d280be2
...
c9b7f9f024
@ -26,7 +26,7 @@ services:
|
||||
|
||||
app:
|
||||
env_file: .env
|
||||
build: ../
|
||||
build: .
|
||||
image: albancrommer/changelog-server:latest
|
||||
ports:
|
||||
- "3000:3000"
|
78
routes/index.js
Normal file
78
routes/index.js
Normal file
@ -0,0 +1,78 @@
|
||||
module.exports = {
|
||||
main: (req, res) => {
|
||||
console.log("request /")
|
||||
res.render('index', { title: 'Hey', message: 'Hello there!' })
|
||||
res.end('wut')
|
||||
|
||||
//
|
||||
// res.type('html')
|
||||
// res.send(`<html>
|
||||
//<head>
|
||||
//<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
//<title>Welcome to Alex's express.js example</title>
|
||||
//</head>
|
||||
//<body>
|
||||
// <h3>Hi, thanks for using my Express.js lab 👏</h3>
|
||||
//
|
||||
// <p>If you found it useful, <a href="https://github.com/alexellis/">view my other GitHub projects</a> today 👑</p>
|
||||
//
|
||||
// <p>Results from <quote>GET <a href="/links">/links</a></quote>:</p>
|
||||
//
|
||||
// <div id="links">
|
||||
// </div>
|
||||
//
|
||||
// <p>Copyright <a href="https://www.alexellis.io/">Alex Ellis 2020 ®</a></p>
|
||||
// <script>
|
||||
// $(document).ready(function(){
|
||||
// $.get("/links", function(data, status){
|
||||
// var res = "<ul>";
|
||||
// var links = data;
|
||||
// for(var i=0; i < links.length; i++) {
|
||||
// res += "<li><a href=" + links[i].url + ">" + links[i].name + "</a></li>"
|
||||
// }
|
||||
// $("#links").html(res)
|
||||
// });
|
||||
// });
|
||||
// </script>
|
||||
// </body>
|
||||
//</html>
|
||||
//`);
|
||||
},
|
||||
links: (req, res) => {
|
||||
res.type("json")
|
||||
res.send(
|
||||
[
|
||||
{
|
||||
"name": "github",
|
||||
"url": "https://github.com/alexellis"
|
||||
},
|
||||
{
|
||||
"name": "twitter",
|
||||
"url": "https://twitter.com/alexellisuk"
|
||||
},
|
||||
{
|
||||
"name": "blog",
|
||||
"url": "https://blog.alexellis.io"
|
||||
},
|
||||
{
|
||||
"name": "sponsors",
|
||||
"url": "https://github.com/users/alexellis/sponsorship"
|
||||
},
|
||||
])
|
||||
},
|
||||
health: (req, res) => {
|
||||
|
||||
// Do an ES request
|
||||
client.ping({
|
||||
// ping usually has a 3000ms timeout
|
||||
requestTimeout: 1000
|
||||
}, function (error) {
|
||||
if (error) {
|
||||
console.trace('elasticsearch cluster is down!');
|
||||
} else {
|
||||
console.log('All is well');
|
||||
}
|
||||
});
|
||||
res.send("OK");
|
||||
}
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: changelog-server
|
||||
labels:
|
||||
app: changelog-server
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: changelog-server
|
||||
# strategy:
|
||||
# type: RollingUpdate
|
||||
# rollingUpdate:
|
||||
# maxSurge: 1
|
||||
# maxUnavailable: 1
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: changelog-server
|
||||
spec:
|
||||
|
||||
initContainers:
|
||||
- name: set-vm-sync-limit
|
||||
image: busybox
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["sysctl", "-w", "vm.max_map_count=262144"]
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumes:
|
||||
- name: changelog-server-esdata
|
||||
hostPath:
|
||||
# directory location on host
|
||||
path: /data
|
||||
# this field is optional
|
||||
type: Directory
|
||||
containers:
|
||||
- name: app
|
||||
image: albancrommer/changelog-server:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
protocol: TCP
|
||||
- name: es
|
||||
image: blacktop/elasticsearch:7.7
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 9200
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
# - name: elastic-config
|
||||
# mountPath: /etc/elasticsearch/elasticsearch.yaml
|
||||
# subPath: elasticsearch.yaml
|
||||
- name : changelog-server-esdata
|
||||
mountPath: /usr/share/elasticsearch/data
|
||||
env:
|
||||
- name: node.name
|
||||
value: "es01"
|
||||
- name: cluster.name
|
||||
value: "es-docker-cluster"
|
||||
- name: bootstrap.memory_lock
|
||||
value: "true"
|
||||
- name: ES_JAVA_OPTS
|
||||
value: "-Xms512m -Xmx512m"
|
||||
|
||||
|
@ -1,10 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
labels:
|
||||
product: k8s-elastic
|
||||
name: elastic-config
|
||||
data:
|
||||
elasticsearch.yaml: |
|
||||
discovery.type: single-node
|
||||
|
@ -1,13 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: changelog-server
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: www
|
||||
port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: changelog-server
|
@ -1,43 +0,0 @@
|
||||
#apiVersion: v1
|
||||
#kind: PersistentVolume
|
||||
#metadata:
|
||||
# name: changelog-server
|
||||
#spec:
|
||||
# capacity:
|
||||
# storage: 2Mi
|
||||
# volumeMode: Filesystem
|
||||
# accessModes:
|
||||
# - ReadWriteOnce
|
||||
# persistentVolumeReclaimPolicy: Retain
|
||||
|
||||
#---
|
||||
#
|
||||
#apiVersion: v1
|
||||
#kind: PersistentVolume
|
||||
#metadata:
|
||||
# name: changelog-server
|
||||
#spec:
|
||||
# capacity:
|
||||
# storage: 5Gi
|
||||
# volumeMode: Filesystem
|
||||
# accessModes:
|
||||
# - ReadWriteOnce
|
||||
# persistentVolumeReclaimPolicy: Retain
|
||||
# HostPath :
|
||||
# path: /changelog-server-es01data
|
||||
#
|
||||
#
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: changelog-server-esdata
|
||||
labels:
|
||||
type: local
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 1Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/changelog-server-esdata"
|
Loading…
Reference in New Issue
Block a user