From 0a88be36f5fd8cc3bdaea081612a1f5fd4c6a23e Mon Sep 17 00:00:00 2001 From: Antoine Legrand <2t.antoine@gmail.com> Date: Wed, 22 Aug 2018 15:37:22 +0200 Subject: [PATCH] Update labels --- deploy/configmap.yaml | 2 +- deploy/default-backend.yaml | 12 +++-- deploy/mandatory.yaml | 46 +++++++++++++++---- deploy/monitoring/configuration.yaml | 3 +- deploy/monitoring/grafana.yaml | 19 ++++++-- deploy/monitoring/prometheus.yaml | 29 ++++++++++-- deploy/provider/aws/patch-configmap-l4.yaml | 3 +- deploy/provider/aws/patch-configmap-l7.yaml | 3 +- deploy/provider/aws/service-l4.yaml | 5 +- deploy/provider/aws/service-l7.yaml | 7 +-- deploy/provider/aws/service-nlb.yaml | 5 +- .../provider/baremetal/service-nodeport.yaml | 6 ++- deploy/provider/cloud-generic.yaml | 5 +- deploy/tcp-services-configmap.yaml | 3 ++ deploy/udp-services-configmap.yaml | 3 ++ deploy/with-rbac.yaml | 11 +++-- 16 files changed, 122 insertions(+), 40 deletions(-) diff --git a/deploy/configmap.yaml b/deploy/configmap.yaml index 9147c790e9..fbcf18ec0b 100644 --- a/deploy/configmap.yaml +++ b/deploy/configmap.yaml @@ -6,4 +6,4 @@ metadata: name: nginx-configuration namespace: ingress-nginx labels: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx diff --git a/deploy/default-backend.yaml b/deploy/default-backend.yaml index 39f78cde3c..a7e28e52fd 100644 --- a/deploy/default-backend.yaml +++ b/deploy/default-backend.yaml @@ -5,17 +5,18 @@ kind: Deployment metadata: name: default-http-backend labels: - app: default-http-backend + app.kubernetes.io/name: default-http-backend + app.kubernetes.io/part-of: ingress-nginx namespace: ingress-nginx spec: replicas: 1 selector: matchLabels: - app: default-http-backend + app.kubernetes.io/name: default-http-backend template: metadata: labels: - app: default-http-backend + app.kubernetes.io/name: default-http-backend spec: terminationGracePeriodSeconds: 60 containers: @@ -48,10 +49,11 @@ metadata: name: default-http-backend namespace: ingress-nginx labels: - app: default-http-backend + app.kubernetes.io/name: default-http-backend + app.kubernetes.io/part-of: ingress-nginx spec: ports: - port: 80 targetPort: 8080 selector: - app: default-http-backend + app.kubernetes.io/name: default-http-backend diff --git a/deploy/mandatory.yaml b/deploy/mandatory.yaml index 5f62c2d437..f860617f06 100644 --- a/deploy/mandatory.yaml +++ b/deploy/mandatory.yaml @@ -11,17 +11,19 @@ kind: Deployment metadata: name: default-http-backend labels: - app: default-http-backend + app.kubernetes.io/name: default-http-backend + app.kubernetes.io/part-of: ingress-nginx namespace: ingress-nginx spec: replicas: 1 selector: matchLabels: - app: default-http-backend + app.kubernetes.io/name: default-http-backend template: metadata: labels: - app: default-http-backend + app.kubernetes.io/name: default-http-backend + app.kubernetes.io/part-of: ingress-nginx spec: terminationGracePeriodSeconds: 60 containers: @@ -54,13 +56,14 @@ metadata: name: default-http-backend namespace: ingress-nginx labels: - app: default-http-backend + app.kubernetes.io/name: default-http-backend + app.kubernetes.io/part-of: ingress-nginx spec: ports: - port: 80 targetPort: 8080 selector: - app: default-http-backend + app.kubernetes.io/name: default-http-backend --- kind: ConfigMap @@ -69,7 +72,8 @@ metadata: name: nginx-configuration namespace: ingress-nginx labels: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx --- kind: ConfigMap @@ -77,6 +81,9 @@ apiVersion: v1 metadata: name: tcp-services namespace: ingress-nginx + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx --- kind: ConfigMap @@ -84,6 +91,9 @@ apiVersion: v1 metadata: name: udp-services namespace: ingress-nginx + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx --- apiVersion: v1 @@ -91,6 +101,9 @@ kind: ServiceAccount metadata: name: nginx-ingress-serviceaccount namespace: ingress-nginx + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx --- @@ -98,6 +111,9 @@ apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: name: nginx-ingress-clusterrole + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx rules: - apiGroups: - "" @@ -153,6 +169,9 @@ kind: Role metadata: name: nginx-ingress-role namespace: ingress-nginx + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx rules: - apiGroups: - "" @@ -196,6 +215,9 @@ kind: RoleBinding metadata: name: nginx-ingress-role-nisa-binding namespace: ingress-nginx + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx roleRef: apiGroup: rbac.authorization.k8s.io kind: Role @@ -211,6 +233,9 @@ apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: nginx-ingress-clusterrole-nisa-binding + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -225,16 +250,19 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: name: nginx-ingress-controller - namespace: ingress-nginx + namespace: ingress-nginx + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx spec: replicas: 1 selector: matchLabels: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx template: metadata: labels: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx annotations: prometheus.io/port: '10254' prometheus.io/scrape: 'true' diff --git a/deploy/monitoring/configuration.yaml b/deploy/monitoring/configuration.yaml index e9669b0bbf..669b181ab0 100644 --- a/deploy/monitoring/configuration.yaml +++ b/deploy/monitoring/configuration.yaml @@ -3,6 +3,8 @@ kind: ConfigMap metadata: name: prometheus-configuration labels: + app.kubernetes.io/name: prometheus + app.kubernetes.io/part-of: ingress-nginx name: prometheus-configuration namespace: ingress-nginx data: @@ -38,4 +40,3 @@ data: - source_labels: [__meta_kubernetes_service_name] regex: prometheus-service action: drop - \ No newline at end of file diff --git a/deploy/monitoring/grafana.yaml b/deploy/monitoring/grafana.yaml index d7102ed45b..df1d43dc9c 100644 --- a/deploy/monitoring/grafana.yaml +++ b/deploy/monitoring/grafana.yaml @@ -2,13 +2,16 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: labels: - name: grafana + app.kubernetes.io/name: grafana + app.kubernetes.io/part-of: ingress-nginx + name: grafana namespace: ingress-nginx spec: selector: matchLabels: - app: grafana + app.kubernetes.io/name: grafana + app.kubernetes.io/part-of: ingress-nginx strategy: rollingUpdate: maxSurge: 1 @@ -17,7 +20,8 @@ spec: template: metadata: labels: - app: grafana + app.kubernetes.io/name: grafana + app.kubernetes.io/part-of: ingress-nginx spec: containers: - image: grafana/grafana @@ -47,11 +51,16 @@ kind: Service metadata: name: grafana namespace: ingress-nginx + labels: + app.kubernetes.io/name: grafana + app.kubernetes.io/part-of: ingress-nginx + spec: ports: - port: 3000 protocol: TCP targetPort: 3000 selector: - app: grafana - type: NodePort \ No newline at end of file + app.kubernetes.io/name: grafana + app.kubernetes.io/part-of: ingress-nginx + type: NodePort diff --git a/deploy/monitoring/prometheus.yaml b/deploy/monitoring/prometheus.yaml index a455e38485..ca762058c2 100644 --- a/deploy/monitoring/prometheus.yaml +++ b/deploy/monitoring/prometheus.yaml @@ -3,9 +3,12 @@ kind: Role metadata: name: prometheus-server namespace: ingress-nginx + labels: + app.kubernetes.io/name: prometheus + app.kubernetes.io/part-of: ingress-nginx rules: - apiGroups: [""] - resources: + resources: - services - endpoints - pods @@ -18,6 +21,9 @@ kind: ServiceAccount metadata: name: prometheus-server namespace: ingress-nginx + labels: + app.kubernetes.io/name: prometheus + app.kubernetes.io/part-of: ingress-nginx --- @@ -26,6 +32,10 @@ kind: RoleBinding metadata: name: prometheus-server namespace: ingress-nginx + labels: + app.kubernetes.io/name: prometheus + app.kubernetes.io/part-of: ingress-nginx + roleRef: apiGroup: rbac.authorization.k8s.io kind: Role @@ -42,15 +52,21 @@ kind: Deployment metadata: name: prometheus-server namespace: ingress-nginx + labels: + app.kubernetes.io/name: prometheus + app.kubernetes.io/part-of: ingress-nginx + spec: replicas: 1 selector: matchLabels: - app: prometheus-server + app.kubernetes.io/name: prometheus + app.kubernetes.io/part-of: ingress-nginx template: metadata: labels: - app: prometheus-server + app.kubernetes.io/name: prometheus + app.kubernetes.io/part-of: ingress-nginx spec: serviceAccountName: prometheus-server containers: @@ -80,9 +96,14 @@ kind: Service metadata: name: prometheus-service namespace: ingress-nginx + labels: + app.kubernetes.io/name: prometheus + app.kubernetes.io/part-of: ingress-nginx + spec: selector: - app: prometheus-server + app.kubernetes.io/name: prometheus + app.kubernetes.io/part-of: ingress-nginx type: NodePort ports: - port: 9090 diff --git a/deploy/provider/aws/patch-configmap-l4.yaml b/deploy/provider/aws/patch-configmap-l4.yaml index 18805a5354..1d612289fb 100644 --- a/deploy/provider/aws/patch-configmap-l4.yaml +++ b/deploy/provider/aws/patch-configmap-l4.yaml @@ -4,6 +4,7 @@ metadata: name: nginx-configuration namespace: ingress-nginx labels: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx data: use-proxy-protocol: "true" diff --git a/deploy/provider/aws/patch-configmap-l7.yaml b/deploy/provider/aws/patch-configmap-l7.yaml index 394f3962c9..45d359edc5 100644 --- a/deploy/provider/aws/patch-configmap-l7.yaml +++ b/deploy/provider/aws/patch-configmap-l7.yaml @@ -4,6 +4,7 @@ metadata: name: nginx-configuration namespace: ingress-nginx labels: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx data: use-proxy-protocol: "false" diff --git a/deploy/provider/aws/service-l4.yaml b/deploy/provider/aws/service-l4.yaml index c22f579278..b3e9664c36 100644 --- a/deploy/provider/aws/service-l4.yaml +++ b/deploy/provider/aws/service-l4.yaml @@ -4,7 +4,8 @@ metadata: name: ingress-nginx namespace: ingress-nginx labels: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx annotations: # Enable PROXY protocol service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: '*' @@ -13,7 +14,7 @@ metadata: spec: type: LoadBalancer selector: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx ports: - name: http port: 80 diff --git a/deploy/provider/aws/service-l7.yaml b/deploy/provider/aws/service-l7.yaml index 78783a255f..8ea1127377 100644 --- a/deploy/provider/aws/service-l7.yaml +++ b/deploy/provider/aws/service-l7.yaml @@ -4,10 +4,11 @@ metadata: name: ingress-nginx namespace: ingress-nginx labels: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx annotations: # replace with the correct value of the generated certificate in the AWS console - service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-west-2:XXXXXXXX:certificate/XXXXXX-XXXXXXX-XXXXXXX-XXXXXXXX" + service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-west-2:XXXXXXXX:certificate/XXXXXX-XXXXXXX-XXXXXXX-XXXXXXXX" # the backend instances are HTTP service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "http" # Map port 443 @@ -17,7 +18,7 @@ metadata: spec: type: LoadBalancer selector: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx ports: - name: http port: 80 diff --git a/deploy/provider/aws/service-nlb.yaml b/deploy/provider/aws/service-nlb.yaml index 3db8dc4d5b..83e1231562 100644 --- a/deploy/provider/aws/service-nlb.yaml +++ b/deploy/provider/aws/service-nlb.yaml @@ -4,7 +4,8 @@ metadata: name: ingress-nginx namespace: ingress-nginx labels: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx annotations: # by default the type is elb (classic load balancer). service.beta.kubernetes.io/aws-load-balancer-type: nlb @@ -13,7 +14,7 @@ spec: externalTrafficPolicy: Local type: LoadBalancer selector: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx ports: - name: http port: 80 diff --git a/deploy/provider/baremetal/service-nodeport.yaml b/deploy/provider/baremetal/service-nodeport.yaml index a00f2453bd..7296ea948a 100644 --- a/deploy/provider/baremetal/service-nodeport.yaml +++ b/deploy/provider/baremetal/service-nodeport.yaml @@ -3,6 +3,10 @@ kind: Service metadata: name: ingress-nginx namespace: ingress-nginx + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + spec: type: NodePort ports: @@ -15,4 +19,4 @@ spec: targetPort: 443 protocol: TCP selector: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx diff --git a/deploy/provider/cloud-generic.yaml b/deploy/provider/cloud-generic.yaml index 8d2f715051..53560770ed 100644 --- a/deploy/provider/cloud-generic.yaml +++ b/deploy/provider/cloud-generic.yaml @@ -4,12 +4,13 @@ metadata: name: ingress-nginx namespace: ingress-nginx labels: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx spec: externalTrafficPolicy: Local type: LoadBalancer selector: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx ports: - name: http port: 80 diff --git a/deploy/tcp-services-configmap.yaml b/deploy/tcp-services-configmap.yaml index f27f6ec35b..4623d095ce 100644 --- a/deploy/tcp-services-configmap.yaml +++ b/deploy/tcp-services-configmap.yaml @@ -5,3 +5,6 @@ apiVersion: v1 metadata: name: tcp-services namespace: ingress-nginx + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx diff --git a/deploy/udp-services-configmap.yaml b/deploy/udp-services-configmap.yaml index ddf2fc7b21..8d858b4b9c 100644 --- a/deploy/udp-services-configmap.yaml +++ b/deploy/udp-services-configmap.yaml @@ -5,3 +5,6 @@ apiVersion: v1 metadata: name: udp-services namespace: ingress-nginx + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx diff --git a/deploy/with-rbac.yaml b/deploy/with-rbac.yaml index 624d908e2a..d2803f57e0 100644 --- a/deploy/with-rbac.yaml +++ b/deploy/with-rbac.yaml @@ -4,16 +4,21 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: name: nginx-ingress-controller - namespace: ingress-nginx + namespace: ingress-nginx + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx spec: replicas: 1 selector: matchLabels: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx template: metadata: labels: - app: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx annotations: prometheus.io/port: '10254' prometheus.io/scrape: 'true'