-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.balx | ||
*.log |
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,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); | ||
} | ||
} |
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 @@ | ||
# 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 |
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,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: [] |
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,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" |