Skip to content

Commit

Permalink
Align app labels with kubernetes recommendations (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
etsauer committed Apr 14, 2020
1 parent 270b6f1 commit 82a03fa
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 9 deletions.
6 changes: 5 additions & 1 deletion basic-spring-boot/.applier/group_vars/seed-hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ openshift_cluster_content:
READINESS_PATH: "{{ sb_application_readiness_path }}"
tags:
- deployment
- name: "deply stage environment"
- name: "deploy stage environment"
template: "{{ inventory_dir }}/../.openshift/templates/deployment.yml"
params_from_vars:
APPLICATION_NAME: "{{ sb_application_name }}"
Expand All @@ -68,3 +68,7 @@ openshift_cluster_content:
READINESS_PATH: "{{ sb_application_readiness_path }}"
tags:
- deployment
- name: "deploy jenkins to build environment"
template: "openshift//jenkins-ephemeral"
tags:
- build
2 changes: 2 additions & 0 deletions basic-spring-boot/.openshift/projects/projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ items:
apiVersion: v1
metadata:
name: basic-spring-boot-prod
labels:
environment: production
creationTimestam: null
displayName: Spring Rest App - Prod
18 changes: 15 additions & 3 deletions basic-spring-boot/.openshift/templates/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ objects:
kind: ImageStream
metadata:
labels:
application: ${APPLICATION_NAME}
app.kubernetes.io/name: ${APPLICATION_NAME}
app.kubernetes.io/instance: ${APPLICATION_NAME}-build
app.kubernetes.io/component: api
app.kubernetes.io/part-of: ${APPLICATION_NAME}
app.kubernetes.io/managed-by: applier
name: ${APPLICATION_NAME}
namespace: ${NAMESPACE}
- kind: "BuildConfig"
apiVersion: "v1"
metadata:
labels:
application: ${APPLICATION_NAME}
app.kubernetes.io/name: ${APPLICATION_NAME}
app.kubernetes.io/instance: ${APPLICATION_NAME}-build
app.kubernetes.io/component: api
app.kubernetes.io/part-of: ${APPLICATION_NAME}
app.kubernetes.io/managed-by: applier
name: "${APPLICATION_NAME}-pipeline"
namespace: "${NAMESPACE}"
spec:
Expand Down Expand Up @@ -49,7 +57,11 @@ objects:
kind: BuildConfig
metadata:
labels:
application: ${APPLICATION_NAME}
app.kubernetes.io/name: ${APPLICATION_NAME}
app.kubernetes.io/instance: ${APPLICATION_NAME}-build
app.kubernetes.io/component: api
app.kubernetes.io/part-of: ${APPLICATION_NAME}
app.kubernetes.io/managed-by: applier
name: ${APPLICATION_NAME}
namespace: "${NAMESPACE}"
spec:
Expand Down
35 changes: 30 additions & 5 deletions basic-spring-boot/.openshift/templates/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ objects:
annotations:
description: The web server's http port.
labels:
app: ${APPLICATION_NAME}
app.kubernetes.io/name: ${APPLICATION_NAME}
app.kubernetes.io/instance: ${APPLICATION_NAME}
app.kubernetes.io/component: api
app.kubernetes.io/part-of: ${APPLICATION_NAME}
app.kubernetes.io/managed-by: applier
name: ${APPLICATION_NAME}
namespace: ${NAMESPACE}
spec:
Expand All @@ -31,7 +35,11 @@ objects:
annotations:
description: Route for application's http service.
labels:
app: ${APPLICATION_NAME}
app.kubernetes.io/name: ${APPLICATION_NAME}
app.kubernetes.io/instance: ${APPLICATION_NAME}
app.kubernetes.io/component: api
app.kubernetes.io/part-of: ${APPLICATION_NAME}
app.kubernetes.io/managed-by: applier
name: ${APPLICATION_NAME}
namespace: ${NAMESPACE}
spec:
Expand All @@ -42,14 +50,22 @@ objects:
kind: ImageStream
metadata:
labels:
app: ${APPLICATION_NAME}
app.kubernetes.io/name: ${APPLICATION_NAME}
app.kubernetes.io/instance: ${APPLICATION_NAME}
app.kubernetes.io/component: api
app.kubernetes.io/part-of: ${APPLICATION_NAME}
app.kubernetes.io/managed-by: applier
name: ${APPLICATION_NAME}
namespace: ${NAMESPACE}
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: ${APPLICATION_NAME}
app.kubernetes.io/name: ${APPLICATION_NAME}
app.kubernetes.io/instance: ${APPLICATION_NAME}
app.kubernetes.io/component: api
app.kubernetes.io/part-of: ${APPLICATION_NAME}
app.kubernetes.io/managed-by: applier
name: ${APPLICATION_NAME}
namespace: ${NAMESPACE}
spec:
Expand All @@ -61,7 +77,11 @@ objects:
template:
metadata:
labels:
app: ${APPLICATION_NAME}
app.kubernetes.io/name: ${APPLICATION_NAME}
app.kubernetes.io/instance: ${APPLICATION_NAME}
app.kubernetes.io/component: api
app.kubernetes.io/part-of: ${APPLICATION_NAME}
app.kubernetes.io/managed-by: applier
deploymentConfig: ${APPLICATION_NAME}
name: ${APPLICATION_NAME}
spec:
Expand Down Expand Up @@ -105,6 +125,11 @@ objects:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/name: ${APPLICATION_NAME}
app.kubernetes.io/instance: ${APPLICATION_NAME}
app.kubernetes.io/component: api
app.kubernetes.io/part-of: ${APPLICATION_NAME}
app.kubernetes.io/managed-by: applier
template: basic-tomcat-template
name: jenkins_edit
namespace: ${NAMESPACE}
Expand Down

0 comments on commit 82a03fa

Please sign in to comment.