Permalink
Browse files

Hello World Kubernetes By Ballerina

  • Loading branch information...
abdennour
abdennour committed Jul 20, 2018
1 parent 1b45ff3 commit 11ad13ed7bfeccd854fef3ab06981dfd07d1acc6
View
@@ -0,0 +1,2 @@
*.balx
*.log
View
@@ -0,0 +1,29 @@
import ballerina/http;
import ballerina/log;
import ballerinax/kubernetes;
@kubernetes:Service {
serviceType: "NodePort",
name: "ballerina-demo"
}
endpoint http:Listener helloListener {
port:8888
};
@kubernetes:Deployment {
enableLiveness: true,
image: "abdennour/ballerina-demo",
name: "ballerina-demo"
}
@http:ServiceConfig {
basePath: "/"
}
service<http:Service> hello bind helloListener {
sayHello (endpoint caller, http:Request request) {
http:Response response = new;
response.setPayload("Hello Kubernetes from elegance.abdennoor.com!");
_ = caller -> respond(response);
}
}
@@ -0,0 +1,10 @@
# Auto Generated Dockerfile
FROM ballerina/ballerina:0.975.1
LABEL maintainer="dev@ballerina.io"
COPY hello_kubernetes.balx /home/ballerina
EXPOSE 8888
CMD ballerina run hello_kubernetes.balx
@@ -0,0 +1,43 @@
---
apiVersion: "extensions/v1beta1"
kind: "Deployment"
metadata:
annotations: {}
finalizers: []
labels:
app: "hello_kubernetes"
name: "ballerina-demo"
ownerReferences: []
spec:
replicas: 1
template:
metadata:
annotations: {}
finalizers: []
labels:
app: "hello_kubernetes"
ownerReferences: []
spec:
containers:
- args: []
command: []
env: []
envFrom: []
image: "abdennour/ballerina-demo"
imagePullPolicy: "IfNotPresent"
livenessProbe:
initialDelaySeconds: 10
periodSeconds: 5
tcpSocket:
port: 8888
name: "ballerina-demo"
ports:
- containerPort: 8888
protocol: "TCP"
volumeMounts: []
hostAliases: []
imagePullSecrets: []
initContainers: []
nodeSelector: {}
tolerations: []
volumes: []
@@ -0,0 +1,20 @@
---
apiVersion: "v1"
kind: "Service"
metadata:
annotations: {}
finalizers: []
labels:
app: "hello_kubernetes"
name: "ballerina-demo"
ownerReferences: []
spec:
externalIPs: []
loadBalancerSourceRanges: []
ports:
- port: 8888
protocol: "TCP"
targetPort: 8888
selector:
app: "hello_kubernetes"
type: "NodePort"

0 comments on commit 11ad13e

Please sign in to comment.