Devfile | ++ | Kubernetes Deployment | +
+ +```yaml +metadata: + # highlight-start + name: my-sample-java-springboot + projectType: spring + # highlight-end + language: java +components: +- name: tools + container: + annotation: + deployment: + # highlight-start + example.com/my-annotation: value-1 + # highlight-end +``` + | +=> | ++ +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + # highlight-next-line + name: my-sample-java-springboot-app + annotations: + # highlight-start + odo.dev/project-type: spring + example.com/my-annotation: value-1 + # highlight-end +spec: + template: + metadata: + # highlight-next-line + name: my-sample-java-springboot-app + annotations: + # highlight-start + odo.dev/project-type: spring + example.com/my-annotation: value-1 + # highlight-end +``` + | +
Devfile | ++ | Kubernetes Deployment | +
+ +```yaml +metadata: + # highlight-start + name: my-sample-java-springboot + projectType: spring + # highlight-end + language: java +components: +- name: tools + container: + ... +``` + | +=> | ++ +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + # highlight-next-line + name: my-sample-java-springboot-app + labels: + # highlight-start + app: app + app.kubernetes.io/instance: my-sample-java-springboot + app.kubernetes.io/managed-by: odo + app.kubernetes.io/managed-by-version: v3.0.0 + app.kubernetes.io/part-of: app + app.openshift.io/runtime: spring + component: my-sample-java-springboot + odo.dev/mode: Dev + # highlight-end +spec: + template: + metadata: + # highlight-next-line + name: my-sample-java-springboot-app + labels: + # highlight-start + app: app + app.kubernetes.io/instance: my-sample-java-springboot + app.kubernetes.io/managed-by: odo + app.kubernetes.io/managed-by-version: v3.0.0 + app.kubernetes.io/part-of: app + app.openshift.io/runtime: spring + component: my-sample-java-springboot + odo.dev/mode: Dev + # highlight-end + selector: + matchLabels: + component: my-sample-java-springboot +``` + | +
Devfile | ++ | Kubernetes Deployment | +
+ +```yaml +metadata: + # highlight-next-line + name: my-sample-java-springboot +components: +- name: tools + container: + image: quay.io/eclipse/che-java11-maven + # highlight-start + mountSources: true + sourceMapping: /my-code + # highlight-end + env: + # highlight-start + - name: DEBUG_PORT + value: "5858" + # highlight-end +- name: another-container + container: + image: alpine:latest + # highlight-next-line + mountSources: false + env: + # highlight-start + - name: MY_ENV_VAR + value: "some value" + # highlight-end +``` + | +=> | ++ +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + # highlight-next-line + name: my-sample-java-springboot-app +spec: + template: + metadata: + # highlight-next-line + name: my-sample-java-springboot-app + spec: + containers: + - name: tools + env: + # highlight-start + - name: DEBUG_PORT + value: "5858" + - name: PROJECTS_ROOT + value: /my-code + - name: PROJECT_SOURCE + value: /my-code + # highlight-end + image: quay.io/eclipse/che-java11-maven + imagePullPolicy: Always + - name: another-container + env: + # highlight-start + - name: MY_ENV_VAR + value: "some value" + # highlight-end + image: alpine:latest + imagePullPolicy: Always + +``` + | +
Devfile | ++ | Kubernetes Deployment | +
+ +```yaml +metadata: + # highlight-next-line + name: my-sample-java-springboot + projectType: spring + language: java +components: +- name: tools + container: + image: quay.io/eclipse/che-java11-maven + # no command or args fields set +``` + | +=> | ++ +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + # highlight-next-line + name: my-sample-java-springboot-app +spec: + template: + metadata: + # highlight-next-line + name: my-sample-java-springboot-app + spec: + containers: + - name: tools + # highlight-start + command: ['tail'] + args: ['-f', '/dev/null'] + # highlight-end + image: quay.io/eclipse/che-java11-maven + imagePullPolicy: Always +``` + | +
+ +```yaml +metadata: + # highlight-next-line + name: my-sample-java-springboot +components: +- name: tools + container: + image: quay.io/eclipse/che-java11-maven + # highlight-start + command: ['/bin/my-entrypoint.sh'] + args: ['arg1', 'arg2'] + # highlight-end +``` + | +=> | ++ +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + # highlight-next-line + name: my-sample-java-springboot-app +spec: + template: + metadata: + # highlight-next-line + name: my-sample-java-springboot-app + spec: + containers: + - name: tools + # highlight-start + command: ['/bin/my-entrypoint.sh'] + args: ['arg1', 'arg2'] + # highlight-end + image: quay.io/eclipse/che-java11-maven + imagePullPolicy: Always +``` + | +
Devfile | ++ | Kubernetes Deployment | +
+ +```yaml +metadata: + # highlight-next-line + name: my-sample-java-springboot +components: +- name: tools + container: + image: quay.io/eclipse/che-java11-maven + # highlight-start + cpuLimit: 500m + cpuRequest: 250m + memoryLimit: 512Mi + memoryRequest: 256Mi + # highlight-end +``` + | +=> | ++ +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + # highlight-next-line + name: my-sample-java-springboot-app +spec: + template: + metadata: + # highlight-next-line + name: my-sample-java-springboot-app + spec: + containers: + - name: tools + # highlight-start + resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 250m + memory: 256Mi + # highlight-end + image: quay.io/eclipse/che-java11-maven + imagePullPolicy: Always +``` + | +
Devfile | ++ | Kubernetes Deployment | +
+ +```yaml +metadata: + # highlight-next-line + name: my-sample-java-springboot +components: +- name: tools + container: + image: quay.io/eclipse/che-java11-maven + # highlight-start + endpoints: + - name: http-springboot + targetPort: 8080 + - name: my-custom-ep + targetPort: 3000 + protocol: http + exposure: internal + - name: debug + targetPort: 5858 + exposure: none + # highlight-end +``` + | +=> | ++ +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + # highlight-next-line + name: my-sample-java-springboot-app +spec: + template: + metadata: + # highlight-next-line + name: my-sample-java-springboot-app + spec: + containers: + - name: tools + # highlight-start + ports: + - containerPort: 8080 + name: http-springboot + protocol: TCP + - containerPort: 3000 + name: my-custom-ep + protocol: TCP + - containerPort: 5858 + name: debug + protocol: TCP + # highlight-end + image: quay.io/eclipse/che-java11-maven + imagePullPolicy: Always +``` + | +
Devfile | ++ | Kubernetes Deployment | +
+ +```yaml +metadata: + # highlight-next-line + name: my-sample-java-springboot +components: + - name: tools + container: + # highlight-start + volumeMounts: + - name: ephemeral-data + path: /tmp + - name: m2 + path: /home/user/.m2 + # highlight-end + image: quay.io/eclipse/che-java11-maven + mountSources: false + - name: m2 + # highlight-start + volume: + size: 3Gi + # highlight-end + - name: ephemeral-data + # highlight-start + volume: + ephemeral: true + size: 1Gi + # highlight-end +``` + | +=> | ++ +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + # highlight-next-line + name: my-sample-java-springboot-app +spec: + template: + metadata: + # highlight-next-line + name: my-sample-java-springboot-app + spec: + volumes: + # highlight-start + - name: odo-shared-data + emptyDir: {} + - name: ephemeral-data + emptyDir: + sizeLimit: 1Gi + - name: m2-my-sample-java-springboot-app-vol + persistentVolumeClaim: + # odo also creates and manages this PVC + claimName: m2-my-sample-java-springboot-app + # highlight-end + containers: + - name: tools + # highlight-start + volumeMounts: + - name: odo-shared-data + mountPath: /opt/odo/ + - name: ephemeral-data + mountPath: /tmp + - name: m2-my-sample-java-springboot-app-vol + mountPath: /home/user/.m2 + # highlight-end +``` + | +
Devfile | ++ | Kubernetes Deployment | +
+ +```yaml +metadata: + # highlight-next-line + name: my-sample-java-springboot +components: + - name: tools + container: + image: quay.io/eclipse/che-java11-maven + # highlight-start + mountSources: true + sourceMapping: /my-code + # highlight-end +``` + | +=> | ++ +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + # highlight-next-line + name: my-sample-java-springboot-app +spec: + template: + metadata: + # highlight-next-line + name: my-sample-java-springboot-app + spec: + volumes: + # highlight-start + - name: odo-shared-data + emptyDir: {} + - name: odo-projects + persistentVolumeClaim: + # odo also creates and manages this PVC + claimName: odo-projects-my-sample-java-springboot-app + # highlight-end + containers: + - name: tools + env: + - name: PROJECTS_ROOT + value: /my-code + - name: PROJECT_SOURCE + value: /my-code + # highlight-start + volumeMounts: + - name: odo-shared-data + mountPath: /opt/odo/ + - name: odo-projects + mountPath: /my-code + # highlight-end +``` + | +
Devfile | ++ | Kubernetes Deployment | +
+ +```yaml +metadata: + # highlight-next-line + name: my-sample-java-springboot +components: + - name: tools + container: + image: quay.io/eclipse/che-java11-maven + # highlight-start + mountSources: true + sourceMapping: /my-code + # highlight-end +``` + | +=> | ++ +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + # highlight-next-line + name: my-sample-java-springboot-app +spec: + template: + metadata: + # highlight-next-line + name: my-sample-java-springboot-app + spec: + volumes: + # highlight-start + - name: odo-shared-data + emptyDir: {} + - name: odo-projects + emptyDir: {} + # highlight-end + containers: + - name: tools + env: + - name: PROJECTS_ROOT + value: /my-code + - name: PROJECT_SOURCE + value: /my-code + # highlight-start + volumeMounts: + - name: odo-shared-data + mountPath: /opt/odo/ + - name: odo-projects + mountPath: /my-code + # highlight-end +``` + | +
Devfile | ++ | Kubernetes Deployment | +
+ +```yaml +metadata: + # highlight-next-line + name: my-sample-java-springboot +components: + - name: tools + container: + image: quay.io/eclipse/che-java11-maven + # highlight-start + mountSources: false + sourceMapping: /my-code + # highlight-end +``` + | +=> | ++ +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + # highlight-next-line + name: my-sample-java-springboot-app +spec: + template: + metadata: + # highlight-next-line + name: my-sample-java-springboot-app + spec: + volumes: + # highlight-start + - name: odo-shared-data + emptyDir: {} + - name: odo-projects + persistentVolumeClaim: + # odo also creates and manages this PVC + claimName: odo-projects-my-sample-java-springboot-app + # highlight-end + containers: + - name: tools + # highlight-start + volumeMounts: + - name: odo-shared-data + mountPath: /opt/odo/ + # highlight-end +``` + | +
Devfile | ++ | Kubernetes Deployment | +
+ +```yaml +metadata: + # highlight-next-line + name: my-sample-java-springboot +components: + - name: tools + container: + image: quay.io/eclipse/che-java11-maven + # highlight-start + mountSources: false + sourceMapping: /my-code + # highlight-end +``` + | +=> | ++ +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + # highlight-next-line + name: my-sample-java-springboot-app +spec: + template: + metadata: + # highlight-next-line + name: my-sample-java-springboot-app + spec: + volumes: + # highlight-start + - name: odo-shared-data + emptyDir: {} + - name: odo-projects + emptyDir: {} + # highlight-end + containers: + - name: tools + # highlight-start + volumeMounts: + - name: odo-shared-data + mountPath: /opt/odo/ + # highlight-end +``` + | +
Devfile | ++ | Kubernetes Service | +
+ +```yaml +metadata: + # highlight-start + name: my-sample-java-springboot + # highlight-end + projectType: spring + language: java +components: +- name: tools + container: + annotation: + service: + # highlight-start + example.com/my-svc-annotation: value-1 + # highlight-end +``` + | +=> | ++ +```yaml +apiVersion: v1 +kind: Service +metadata: + # highlight-next-line + name: my-sample-java-springboot-app + annotations: + # highlight-start + service.binding/backend_ip: path={.spec.clusterIP} + service.binding/backend_port: path={.spec.ports},elementType=sliceOfMaps,sourceKey=name,sourceValue=port + example.com/my-svc-annotation: value-1 + # highlight-end +spec: + type: ClusterIP + selector: + component: my-sample-java-springboot-app +``` + | +
Devfile | ++ | Kubernetes Service | +
+ +```yaml +metadata: + # highlight-start + name: my-sample-java-springboot + projectType: spring + # highlight-end + language: java +components: +- name: tools + container: + ... +``` + | +=> | ++ +```yaml +apiVersion: v1 +kind: Service +metadata: + # highlight-next-line + name: my-sample-java-springboot-app + labels: + # highlight-start + app: app + app.kubernetes.io/instance: my-sample-java-springboot + app.kubernetes.io/managed-by: odo + app.kubernetes.io/managed-by-version: v3.0.0 + app.kubernetes.io/part-of: app + app.openshift.io/runtime: spring + component: my-sample-java-springboot + odo.dev/mode: Dev + # highlight-end +spec: + type: ClusterIP + selector: + # highlight-next-line + component: my-sample-java-springboot-app +``` + | +
Devfile | ++ | Kubernetes Service | +
+ +```yaml +metadata: + # highlight-next-line + name: my-sample-java-springboot +components: + - id: my-container1 + container: + endpoints: + # highlight-start + - name: http-springboot + targetPort: 8080 + - name: my-custom-ep + targetPort: 3000 + exposure: internal + - name: debug + targetPort: 5005 + exposure: none + # highlight-end + - id: my-container2 + container: + endpoints: + # highlight-start + - name: another-ep + targetPort: 9090 + # highlight-end +``` + | +=> | ++ +```yaml +apiVersion: v1 +kind: Service +metadata: + # highlight-next-line + name: my-sample-java-springboot-app +spec: + type: ClusterIP + ports: + # highlight-start + - name: http-springboot + port: 8080 + protocol: TCP + targetPort: 8080 + - name: my-custom-ep + port: 3000 + protocol: TCP + targetPort: 3000 + - name: another-ep + port: 9090 + protocol: TCP + targetPort: 3000 + # highlight-end +``` + + | +