Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create version 2.0.0 for python sample #35

Merged
merged 8 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Creating an application with a Python code sample

**Note:** The Python code sample uses the **8081** HTTP port.
**Note:** The Python code sample version `2.0.0` uses the **8081** HTTP port.

Before you begin creating an application with this `devfile` code sample, it's helpful to understand the relationship between the `devfile` and `Dockerfile` and how they contribute to your build. You can find these files at the following URLs:

Expand Down
32 changes: 6 additions & 26 deletions devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
'Python is an interpreted, object-oriented, high-level programming language with dynamic semantics.
Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together.'
language: Python
version: 1.0.1
version: 2.0.0
provider: Red Hat
tags:
- Python
Expand All @@ -20,38 +20,18 @@ metadata:
parent:
id: python
registryUrl: 'https://registry.devfile.io'
components:
- name: image-build
image:
imageName: python-image:latest
dockerfile:
uri: docker/Dockerfile
buildContext: .
rootRequired: false
- name: kubernetes-deploy
version: 3.0.0
components:
thepetk marked this conversation as resolved.
Show resolved Hide resolved
- name: deploy
attributes:
deployment/replicas: 1
deployment/cpuRequest: 10m
deployment/memoryRequest: 50Mi
deployment/container-port: 8081
kubernetes:
uri: deploy.yaml
uri: kubernetes/deploy.yaml
endpoints:
- name: http-8081
targetPort: 8081
path: /
commands:
- id: build-image
apply:
component: image-build
- id: deployk8s
apply:
component: kubernetes-deploy
- id: deploy
composite:
commands:
- build-image
- deployk8s
group:
kind: deploy
isDefault: true

14 changes: 7 additions & 7 deletions deploy.yaml → kubernetes/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ apiVersion: v1
metadata:
name: my-python
spec:
ports:
- name: http-8081
port: 8081
protocol: TCP
targetPort: 8081
selector:
app: python-app
ports:
- name: http-8081
port: 8081
protocol: TCP
targetPort: 8081
selector:
app: python-app