Skip to content

Commit

Permalink
Add app.yaml to quickstart archetypes. Update k8s support in docs. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
barchetta authored Jul 8, 2020
1 parent 5280d68 commit f4c2619
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<include>Dockerfile.mustache</include>
<include>Dockerfile.native.mustache</include>
<include>Dockerfile.jlink.mustache</include>
<include>app.yaml.mustache</include>
<include>.dockerignore</include>
</includes>
</template-set>
Expand All @@ -67,6 +68,7 @@
<include>Dockerfile.mustache</include>
<include>Dockerfile.native.mustache</include>
<include>Dockerfile.jlink.mustache</include>
<include>app.yaml.mustache</include>
<include>.dockerignore</include>
</includes>
</template-set>
Expand Down
10 changes: 10 additions & 0 deletions archetypes/quickstart-mp/src/main/resources/README.md.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,19 @@ Exercise the application as described above
kubectl cluster-info # Verify which cluster
kubectl get pods # Verify connectivity to cluster
kubectl create -f app.yaml # Deploy application
kubectl get pods # Wait for quickstart pod to be RUNNING
kubectl get service helidon-quickstart-mp # Verify deployed service
```

Note the PORTs. You can now exercise the application as you did before but use the second
port number (the NodePort) instead of 8080.

After you’re done, cleanup.

```
kubectl delete -f app.yaml
```

## Build a native image with GraalVM

GraalVM allows you to compile your programs ahead-of-time into a native
Expand Down
35 changes: 0 additions & 35 deletions archetypes/quickstart-mp/src/main/resources/app.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions archetypes/quickstart-mp/src/main/resources/app.yaml.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
#
# 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: Service
apiVersion: v1
metadata:
name: {{artifactId}}
labels:
app: {{artifactId}}
spec:
type: NodePort
selector:
app: {{artifactId}}
ports:
- port: 8080
targetPort: 8080
name: http
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: {{artifactId}}
spec:
replicas: 1
selector:
matchLabels:
app: {{artifactId}}
template:
metadata:
labels:
app: {{artifactId}}
version: v1
spec:
containers:
- name: {{artifactId}}
image: {{artifactId}}
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
---
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<include>Dockerfile.mustache</include>
<include>Dockerfile.native.mustache</include>
<include>Dockerfile.jlink.mustache</include>
<include>app.yaml.mustache</include>
<include>.dockerignore</include>
</includes>
</template-set>
Expand All @@ -67,6 +68,7 @@
<include>Dockerfile.mustache</include>
<include>Dockerfile.native.mustache</include>
<include>Dockerfile.jlink.mustache</include>
<include>app.yaml.mustache</include>
<include>.dockerignore</include>
</includes>
</template-set>
Expand Down
10 changes: 10 additions & 0 deletions archetypes/quickstart-se/src/main/resources/README.md.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,19 @@ Exercise the application as described above
kubectl cluster-info # Verify which cluster
kubectl get pods # Verify connectivity to cluster
kubectl create -f app.yaml # Deploy application
kubectl get pods # Wait for quickstart pod to be RUNNING
kubectl get service helidon-quickstart-se # Get service info
```

Note the PORTs. You can now exercise the application as you did before but use the second
port number (the NodePort) instead of 8080.

After you’re done, cleanup.

```
kubectl delete -f app.yaml
```

## Build a native image with GraalVM

GraalVM allows you to compile your programs ahead-of-time into a native
Expand Down
35 changes: 0 additions & 35 deletions archetypes/quickstart-se/src/main/resources/app.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions archetypes/quickstart-se/src/main/resources/app.yaml.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
#
# 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: Service
apiVersion: v1
metadata:
name: {{artifactId}}
labels:
app: {{artifactId}}
spec:
type: NodePort
selector:
app: {{artifactId}}
ports:
- port: 8080
targetPort: 8080
name: http
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: {{artifactId}}
spec:
replicas: 1
selector:
matchLabels:
app: {{artifactId}}
template:
metadata:
labels:
app: {{artifactId}}
version: v1
spec:
containers:
- name: {{artifactId}}
image: {{artifactId}}
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
---
2 changes: 1 addition & 1 deletion docs/about/03_prerequisites.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ deploy to Kubernetes, you need `kubectl` and a Kubernetes cluster (you can
|https://www.oracle.com/technetwork/java/javase/downloads[Java{nbsp}SE{nbsp}11] (http://jdk.java.net[Open{nbsp}JDK{nbsp}11]) or newer
|https://maven.apache.org/download.cgi[Maven 3.6.1+]
|https://docs.docker.com/install/[Docker 18.09+]
|https://kubernetes.io/docs/tasks/tools/install-kubectl/[Kubectl 1.11.9+]
|https://kubernetes.io/docs/tasks/tools/install-kubectl/[Kubectl 1.16.5+]
|=======
Expand Down
2 changes: 1 addition & 1 deletion docs/mp/guides/02_quickstart.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Then you can try the application as you did before.
== Deploy the application to Kubernetes
If you don't have access to a Kubernetes cluster, you can
<<getting-started/05_kubernetes.adoc,install one on your desktop>>.
<<about/05_kubernetes.adoc,install one on your desktop>>.
Then deploy the example:
[source,bash]
Expand Down
2 changes: 1 addition & 1 deletion docs/se/guides/02_quickstart.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Then you can try the application as you did before.
== Deploy the application to Kubernetes
If you don't have access to a Kubernetes cluster, you can
<<getting-started/05_kubernetes.adoc,install one on your desktop>>.
<<about/05_kubernetes.adoc,install one on your desktop>>.
Then deploy the example:
[source,bash]
Expand Down

0 comments on commit f4c2619

Please sign in to comment.