-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: Ibc64e9a8915d71ac588b04e7b39b6227e5c4d510
- Loading branch information
Showing
12 changed files
with
324 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM debian:jessie | ||
|
||
RUN echo 'APT::Install-Recommends "0";\nAPT::Install-Suggests "0";' > /etc/apt/apt.conf.d/01norecommends | ||
|
||
RUN apt-get update && apt-get upgrade -y | ||
|
||
RUN echo "mysql-server mysql-server/root_password password root" | debconf-set-selections | ||
RUN echo "mysql-server mysql-server/root_password_again password root" | debconf-set-selections | ||
|
||
RUN apt-get install -y gcc g++ make autoconf automake autotools-dev git libc6-dev libdb5.3-dev libreadline-dev libmysqlclient-dev libssl-dev git vim openjdk-7-jre-headless gdb gccxml mysql-server | ||
|
||
#RUN find /var/lib/mysql -type f -exec touch {} \; && service mysql start | ||
|
||
#RUN echo 'CREATE DATABASE swgemu;' | mysql -uroot -proot | ||
#RUN echo 'GRANT ALL ON *.* TO `swgemu`@`localhost` IDENTIFIED BY "123456";' | mysql -uroot -proot | ||
|
||
RUN mkdir -p /swgemu/MMOEngine && mkdir -p /swgemu/MMOCoreORB | ||
#RUN ln -s /swgemu/MMOEngine/bin/idlc /usr/local/bin/idlc | ||
|
||
RUN apt-get install -y wget && wget http://www.lua.org/ftp/lua-5.3.3.tar.gz && tar -xvf lua-5.3.3.tar.gz && cd lua-5.3.3 && make linux install && cd .. && rm -R lua-5.3.3 && rm lua-5.3.3.tar.gz && ldconfig | ||
|
||
RUN mkdir -p /home/swgemu/workspace/tre | ||
|
||
#RUN apt-get install -y clang-3.5 | ||
|
||
RUN mkdir git && cd git && git clone http://review.swgemu.com/p/Core3.git && git clone http://review.swgemu.com/p/PublicEngine.git && cd PublicEngine/MMOEngine && make && chmod +x bin/idlc && cp bin/idlc /usr/local/bin/idlc && cd ../../Core3 && git checkout unstable && ln -s ../PublicEngine/MMOEngine MMOEngine | ||
|
||
ENV CLASSPATH="/git/PublicEngine/MMOEngine/bin/idlc.jar" | ||
RUN echo 'export CLASSPATH="/git/PublicEngine/MMOEngine/bin/idlc.jar"' >> /root/.profile | ||
|
||
RUN cd git/Core3/MMOCoreORB && make config && make build | ||
|
||
RUN apt-get install -y supervisor | ||
|
||
# copy the supervisor conf file into the image | ||
ADD scripts/supervisord-core3.conf /etc/supervisor/conf.d/supervisord-core3.conf | ||
|
||
ADD scripts/run.sh /tmp/ | ||
RUN /bin/chmod +x /tmp/run.sh | ||
CMD /tmp/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[supervisord] | ||
nodaemon=true | ||
|
||
[program:core3] | ||
user=root | ||
command=/git/Core3/MMOCoreORB/bin/core3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
description: An SwgEmu cluster | ||
keywords: | ||
- swgemu | ||
- core3 | ||
maintainers: | ||
- email: oru@swgemu.com | ||
name: oru | ||
name: core3 | ||
version: "1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# nginx: An advanced example chart | ||
|
||
This Helm chart provides examples of some of Helm's more powerful | ||
features. | ||
|
||
**This is not a production-grade chart. It is an example.** | ||
|
||
The chart installs a simple nginx server according to the following | ||
pattern: | ||
|
||
- A `ConfigMap` is used to store the files the server will serve. | ||
([templates/configmap.yaml](templates/configmap.yaml)) | ||
- A `Deployment` is used to create a Replica Set of nginx pods. | ||
([templates/deployment.yaml](templates/deployment.yaml)) | ||
- A `Service` is used to create a gateway to the pods running in the | ||
replica set ([templates/svc.yaml](templates/svc.yaml)) | ||
|
||
The [values.yaml](values.yaml) exposes a few of the configuration options in the | ||
charts, though there are some that are not exposed there (like | ||
`.image`). | ||
|
||
The [templates/_helpers.tpl](templates/_helpers.tpl) file contains helper templates. The leading | ||
underscore (`_`) on the filename is semantic. It tells the template renderer | ||
that this file does not contain a manifest. That file declares some | ||
templates that are used elsewhere in the chart. | ||
|
||
Helpers (usually called "partials" in template languages) are an | ||
advanced way for developers to structure their templates for optimal | ||
reuse. | ||
|
||
You can deploy this chart with `helm install docs/examples/nginx`. Or | ||
you can see how this chart would render with `helm install --dry-run | ||
--debug docs/examples/nginx`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{define "name"}}{{default "core3" .Values.nameOverride | trunc 63 | trimSuffix "-" }}{{end}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this | ||
(by the DNS naming spec). | ||
*/}} | ||
{{define "fullname"}} | ||
{{- $name := default "core3" .Values.nameOverride -}} | ||
{{printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# A headless service to create DNS records | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{template "name" .}} | ||
labels: | ||
app: {{template "name" .}} | ||
heritage: {{ .Release.Service | quote }} | ||
release: {{ .Release.Name | quote }} | ||
chart: "{{.Chart.Name}}-{{.Chart.Version}}" | ||
spec: | ||
ports: | ||
- port: {{default 44421 .Values.zonePort}} | ||
name: core3-zone | ||
protocol: UDP | ||
- port: {{default 44422 .Values.pingPort}} | ||
name: core3-ping | ||
protocol: UDP | ||
# - port: {{default 44455 .Values.statusPort}} | ||
# name: core3-status | ||
type: LoadBalancer | ||
selector: | ||
app: {{template "name" .}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
apiVersion: apps/v1beta1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{template "name" .}}-zone | ||
labels: | ||
# The "heritage" label is used to track which tool deployed a given chart. | ||
# It is useful for admins who want to see what releases a particular tool | ||
# is responsible for. | ||
heritage: {{ .Release.Service | quote }} | ||
# This makes it easy to search for all components of a release using kubectl. | ||
release: {{ .Release.Name | quote }} | ||
# This makes it easy to audit chart usage. | ||
chart: "{{.Chart.Name}}-{{.Chart.Version}}" | ||
spec: | ||
serviceName: "{{template "name" .}}" | ||
replicas: {{default 1 .Values.replicas}} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{template "name" .}} | ||
annotations: | ||
pod.alpha.kubernetes.io/initialized: "true" | ||
spec: | ||
terminationGracePeriodSeconds: 0 | ||
containers: | ||
- name: {{template "name" .}} | ||
image: {{default "akimaki/swgemu-core3" .Values.image}}:{{default "1.0" .Chart.Version}} | ||
ports: | ||
- containerPort: {{default 44421 .Values.zonePort}} | ||
name: core3-zone | ||
protocol: UDP | ||
- containerPort: {{default 44422 .Values.pingPort}} | ||
name: core3-ping | ||
protocol: UDP | ||
# - containerPort: {{default 44455 .Values.statusPort}} | ||
# name: core3-status | ||
env: | ||
- name: MYSQL_HOST | ||
valueFrom: | ||
secretKeyRef: | ||
name: mysql-secret | ||
key: host | ||
- name: MYSQL_PORT | ||
valueFrom: | ||
secretKeyRef: | ||
name: mysql-secret | ||
key: port | ||
- name: MYSQL_NAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: mysql-secret | ||
key: name | ||
- name: MYSQL_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: mysql-secret | ||
key: user | ||
- name: MYSQL_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: mysql-secret | ||
key: password | ||
- name: MYSQL_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: mysql-secret | ||
key: secret | ||
volumeMounts: | ||
- name: bdb-database | ||
mountPath: /git/Core3/MMOCoreORB/bin/databases | ||
- name: mysql-varlib | ||
mountPath: /var/lib/mysql | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: bdb-database | ||
annotations: | ||
volume.beta.kubernetes.io/storage-class: local-storage | ||
spec: | ||
accessModes: [ "ReadWriteOnce" ] | ||
resources: | ||
requests: | ||
storage: 50Gi | ||
- metadata: | ||
name: mysql-varlib | ||
annotations: | ||
volume.beta.kubernetes.io/storage-class: local-storage | ||
spec: | ||
accessModes: [ "ReadWriteOnce" ] | ||
resources: | ||
requests: | ||
storage: 1Gi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Default values for nginx. | ||
# This is a YAML-formatted file. | ||
# Declare name/value pairs to be passed into your templates. | ||
|
||
# Number of nginx instances to run | ||
replicaCount: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: mysql-secret | ||
namespace: swgemu | ||
data: | ||
host: host # in base64 | ||
port: port # in base64 | ||
name: name # in base64 | ||
user: user # in base64 | ||
password: password # in base64 | ||
secret: secret # in base64 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
kind: StorageClass | ||
apiVersion: storage.k8s.io/v1beta1 | ||
metadata: | ||
namespace: kube-system | ||
name: local-storage | ||
annotations: | ||
storageclass.beta.kubernetes.io/is-default-class: "false" | ||
labels: | ||
kubernetes.io/cluster-service: "true" | ||
provisioner: kubernetes.io/host-path |