From 38449ccd7abe89807727918a0d4bde2f9411fb0a Mon Sep 17 00:00:00 2001 From: Romain Grecourt Date: Mon, 1 Feb 2021 17:00:48 -0800 Subject: [PATCH] Update k8s descriptors to avoid using deprecated APIs. --- examples/employee-app/app.yaml | 17 +- examples/integrations/cdi/jedis/README.md | 6 +- examples/integrations/cdi/jedis/app.yaml | 48 +-- examples/integrations/cdi/jedis/redis.yaml | 16 +- .../cdi/oci-objectstorage/README.md | 6 +- .../cdi/oci-objectstorage/app.yaml | 109 ++++--- examples/k8s/ingress.yaml | 307 ------------------ examples/k8s/zipkin.yaml | 37 ++- .../helidon-quickstart-mp/app.yaml | 23 +- .../helidon-quickstart-se/app.yaml | 23 +- .../helidon-standalone-quickstart-mp/app.yaml | 39 ++- .../helidon-standalone-quickstart-se/app.yaml | 39 ++- examples/todo-app/README.md | 6 +- examples/todo-app/backend/app.yaml | 28 +- examples/todo-app/cassandra.yaml | 20 +- examples/todo-app/frontend/app.yaml | 49 +-- examples/translator-app/README.md | 4 +- examples/translator-app/backend/app.yaml | 21 +- examples/translator-app/frontend/app.yaml | 46 +-- 19 files changed, 302 insertions(+), 542 deletions(-) delete mode 100644 examples/k8s/ingress.yaml diff --git a/examples/employee-app/app.yaml b/examples/employee-app/app.yaml index b4d8750b902..7e2a29e9095 100644 --- a/examples/employee-app/app.yaml +++ b/examples/employee-app/app.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2019-2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,8 +29,8 @@ spec: targetPort: 8080 name: http --- +apiVersion: apps/v1 kind: Deployment -apiVersion: extensions/v1beta1 metadata: name: helidon-examples-employee-app spec: @@ -42,11 +42,11 @@ spec: version: v1 spec: containers: - - name: helidon-examples-employee-app - image: helidon-examples-employee-app - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 + - name: helidon-examples-employee-app + image: helidon-examples-employee-app + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 --- apiVersion: v1 kind: Service @@ -60,5 +60,4 @@ spec: - port: 80 targetPort: 8080 selector: - app: helidon-examples-employee-app - \ No newline at end of file + app: helidon-examples-employee-app \ No newline at end of file diff --git a/examples/integrations/cdi/jedis/README.md b/examples/integrations/cdi/jedis/README.md index 41c3810f3a5..51311df18e2 100644 --- a/examples/integrations/cdi/jedis/README.md +++ b/examples/integrations/cdi/jedis/README.md @@ -33,7 +33,9 @@ curl http://localhost:8080/jedis/foo ```bash docker build -t helidon-examples-integrations-cdi-jedis . -kubectl apply -f ../../k8s/ingress.yaml -f app.yaml +kubectl apply \ + -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/ingress-nginx-3.15.2/deploy/static/provider/cloud/deploy.yaml \ + -f app.yaml ``` Try the endpoint: @@ -49,5 +51,5 @@ docker stop redis helidon-examples-integrations-cdi-jedis Delete the Kubernetes resources: ```bash -kubectl delete -f ../../k8s/ingress.yaml -f app.yaml +kubectl delete -f app.yaml ``` diff --git a/examples/integrations/cdi/jedis/app.yaml b/examples/integrations/cdi/jedis/app.yaml index 5a3c2b51062..3f812ae47ea 100644 --- a/examples/integrations/cdi/jedis/app.yaml +++ b/examples/integrations/cdi/jedis/app.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,29 +14,32 @@ # limitations under the License. # ---- +apiVersion: apps/v1 kind: Deployment -apiVersion: extensions/v1beta1 metadata: name: helidon-examples-integrations-cdi-jedis + labels: + app: helidon-examples-integrations-cdi-jedis + version: v1 spec: replicas: 1 template: metadata: labels: app: helidon-examples-integrations-cdi-jedis - version: v1 spec: containers: - - name: helidon-examples-integrations-cdi-jedis - image: helidon-examples-integrations-cdi-jedis - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - env: - - name: redis_clients_jedis_JedisPool_default_host - value: redis + - name: helidon-examples-integrations-cdi-jedis + image: helidon-examples-integrations-cdi-jedis + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 + env: + - name: redis_clients_jedis_JedisPool_default_host + value: redis + --- + kind: Service apiVersion: v1 metadata: @@ -51,8 +54,10 @@ spec: selector: app: helidon-examples-integrations-cdi-jedis sessionAffinity: None + --- -apiVersion: extensions/v1beta1 + +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: helidon-examples-integrations-cdi-jedis @@ -60,10 +65,13 @@ metadata: nginx.ingress.kubernetes.io/rewrite-target: /$1 spec: rules: - - host: localhost - http: - paths: - - path: /helidon-cdi-jedis/(.*) - backend: - serviceName: helidon-examples-integrations-cdi-jedis - servicePort: 8080 \ No newline at end of file + - host: localhost + http: + paths: + - path: /helidon-cdi-jedis/(.*) + pathType: Prefix + backend: + service: + name: helidon-examples-integrations-cdi-jedis + port: + number: 8080 diff --git a/examples/integrations/cdi/jedis/redis.yaml b/examples/integrations/cdi/jedis/redis.yaml index d1f32711ef1..045c4a1553b 100644 --- a/examples/integrations/cdi/jedis/redis.yaml +++ b/examples/integrations/cdi/jedis/redis.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2019-2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,10 +29,12 @@ spec: --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: redis + labels: + app: redis spec: replicas: 1 template: @@ -41,8 +43,8 @@ spec: app: redis spec: containers: - - name: redis - image: redis:5 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 6379 + - name: redis + image: redis:5 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 6379 diff --git a/examples/integrations/cdi/oci-objectstorage/README.md b/examples/integrations/cdi/oci-objectstorage/README.md index bc8c4576702..d460b6680e6 100644 --- a/examples/integrations/cdi/oci-objectstorage/README.md +++ b/examples/integrations/cdi/oci-objectstorage/README.md @@ -53,7 +53,9 @@ curl http://localhost:8080/logo/{namespaceName}/{bucketName}/{objectName} ```bash docker build -t helidon-examples-integrations-cdi-oci-objectstorage . ./oci-setup.sh -k8s -kubectl apply -f ../../../k8s/ingress.yaml -f app.yaml +kubectl apply \ + -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/ingress-nginx-3.15.2/deploy/static/provider/cloud/deploy.yaml \ + -f app.yaml ``` Try the endpoint: @@ -69,5 +71,5 @@ docker stop helidon-examples-integrations-cdi-oci-objectstorage Delete the Kubernetes resources: ```bash -kubectl delete -f ../../../k8s/ingress.yaml -f app.yaml +kubectl -f app.yaml ``` diff --git a/examples/integrations/cdi/oci-objectstorage/app.yaml b/examples/integrations/cdi/oci-objectstorage/app.yaml index 45cca1b516b..a501135de0b 100644 --- a/examples/integrations/cdi/oci-objectstorage/app.yaml +++ b/examples/integrations/cdi/oci-objectstorage/app.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,8 +14,8 @@ # limitations under the License. # +apiVersion: apps/v1 kind: Deployment -apiVersion: extensions/v1beta1 metadata: name: helidon-examples-integrations-cdi-oci-objectstorage spec: @@ -24,51 +24,52 @@ spec: metadata: labels: app: helidon-examples-integrations-cdi-oci-objectstorage - version: v1 spec: containers: - - name: helidon-examples-integrations-cdi-oci-objectstorage - image: helidon-examples-integrations-cdi-oci-objectstorage - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - env: - - name: OCI_AUTH_FINGERPRINT - valueFrom: - secretKeyRef: - name: oci-objectstorage-secret - key: OCI_AUTH_FINGERPRINT - - name: OCI_AUTH_PASSPHRASE - valueFrom: - secretKeyRef: - name: oci-objectstorage-secret - key: OCI_AUTH_PASSPHRASE - - name: OCI_AUTH_PRIVATEKEY - valueFrom: - secretKeyRef: - name: oci-objectstorage-secret - key: OCI_AUTH_PRIVATEKEY - - name: OCI_AUTH_TENANCY - valueFrom: - secretKeyRef: - name: oci-objectstorage-secret - key: OCI_AUTH_TENANCY - - name: OCI_AUTH_USER - valueFrom: - secretKeyRef: - name: oci-objectstorage-secret - key: OCI_AUTH_USER - - name: OCI_OBJECTSTORAGE_COMPARTMENT - valueFrom: - secretKeyRef: - name: oci-objectstorage-secret - key: OCI_OBJECTSTORAGE_COMPARTMENT - - name: OCI_OBJECTSTORAGE_REGION - valueFrom: - secretKeyRef: - name: oci-objectstorage-secret - key: OCI_OBJECTSTORAGE_REGION + - name: helidon-examples-integrations-cdi-oci-objectstorage + image: helidon-examples-integrations-cdi-oci-objectstorage + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 + env: + - name: OCI_AUTH_FINGERPRINT + valueFrom: + secretKeyRef: + key: OCI_AUTH_FINGERPRINT + name: oci-objectstorage-secret + - name: OCI_AUTH_PASSPHRASE + valueFrom: + secretKeyRef: + key: OCI_AUTH_PASSPHRASE + name: oci-objectstorage-secret + - name: OCI_AUTH_PRIVATEKEY + valueFrom: + secretKeyRef: + key: OCI_AUTH_PRIVATEKEY + name: oci-objectstorage-secret + - name: OCI_AUTH_TENANCY + valueFrom: + secretKeyRef: + key: OCI_AUTH_TENANCY + name: oci-objectstorage-secret + - name: OCI_AUTH_USER + valueFrom: + secretKeyRef: + key: OCI_AUTH_USER + name: oci-objectstorage-secret + - name: OCI_OBJECTSTORAGE_COMPARTMENT + valueFrom: + secretKeyRef: + key: OCI_OBJECTSTORAGE_COMPARTMENT + name: oci-objectstorage-secret + - name: OCI_OBJECTSTORAGE_REGION + valueFrom: + secretKeyRef: + key: OCI_OBJECTSTORAGE_REGION + name: oci-objectstorage-secret + --- + kind: Service apiVersion: v1 metadata: @@ -83,9 +84,10 @@ spec: selector: app: helidon-examples-integrations-cdi-oci-objectstorage sessionAffinity: None + --- -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: helidon-examples-integrations-cdi-oci-objectstorage @@ -93,10 +95,13 @@ metadata: nginx.ingress.kubernetes.io/rewrite-target: /$1 spec: rules: - - host: localhost - http: - paths: - - path: /oci-objectstorage/(.*) - backend: - serviceName: helidon-examples-integrations-cdi-oci-objectstorage - servicePort: 8080 \ No newline at end of file + - host: localhost + http: + paths: + - path: /oci-objectstorage/(.*) + pathType: Prefix + backend: + service: + name: helidon-examples-integrations-cdi-oci-objectstorage + port: + number: 8080 diff --git a/examples/k8s/ingress.yaml b/examples/k8s/ingress.yaml deleted file mode 100644 index fc255104446..00000000000 --- a/examples/k8s/ingress.yaml +++ /dev/null @@ -1,307 +0,0 @@ -# -# Copyright (c) 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. -# - -apiVersion: v1 -kind: Namespace -metadata: - name: ingress-nginx - labels: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx - ---- - -kind: ConfigMap -apiVersion: v1 -metadata: - name: nginx-configuration - namespace: ingress-nginx - labels: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx - ---- -kind: ConfigMap -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 -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 -kind: ServiceAccount -metadata: - name: nginx-ingress-serviceaccount - namespace: ingress-nginx - labels: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx - ---- -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: - - "" - resources: - - configmaps - - endpoints - - nodes - - pods - - secrets - verbs: - - list - - watch - - apiGroups: - - "" - resources: - - nodes - verbs: - - get - - apiGroups: - - "" - resources: - - services - verbs: - - get - - list - - watch - - apiGroups: - - "" - resources: - - events - verbs: - - create - - patch - - apiGroups: - - "extensions" - - "networking.k8s.io" - resources: - - ingresses - verbs: - - get - - list - - watch - - apiGroups: - - "extensions" - - "networking.k8s.io" - resources: - - ingresses/status - verbs: - - update - ---- -apiVersion: rbac.authorization.k8s.io/v1beta1 -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: - - "" - resources: - - configmaps - - pods - - secrets - - namespaces - verbs: - - get - - apiGroups: - - "" - resources: - - configmaps - resourceNames: - # Defaults to "-" - # Here: "-" - # This has to be adapted if you change either parameter - # when launching the nginx-ingress-controller. - - "ingress-controller-leader-nginx" - verbs: - - get - - update - - apiGroups: - - "" - resources: - - configmaps - verbs: - - create - - apiGroups: - - "" - resources: - - endpoints - verbs: - - get - ---- -apiVersion: rbac.authorization.k8s.io/v1beta1 -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 - name: nginx-ingress-role -subjects: - - kind: ServiceAccount - name: nginx-ingress-serviceaccount - namespace: ingress-nginx - ---- -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 - name: nginx-ingress-clusterrole -subjects: - - kind: ServiceAccount - name: nginx-ingress-serviceaccount - namespace: ingress-nginx - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nginx-ingress-controller - namespace: ingress-nginx - labels: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx - template: - metadata: - labels: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx - annotations: - prometheus.io/port: "10254" - prometheus.io/scrape: "true" - spec: - serviceAccountName: nginx-ingress-serviceaccount - containers: - - name: nginx-ingress-controller - image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.25.1 - args: - - /nginx-ingress-controller - - --configmap=$(POD_NAMESPACE)/nginx-configuration - - --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services - - --udp-services-configmap=$(POD_NAMESPACE)/udp-services - - --publish-service=$(POD_NAMESPACE)/ingress-nginx - - --annotations-prefix=nginx.ingress.kubernetes.io - securityContext: - allowPrivilegeEscalation: true - capabilities: - drop: - - ALL - add: - - NET_BIND_SERVICE - # www-data -> 33 - runAsUser: 33 - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - ports: - - name: http - containerPort: 80 - - name: https - containerPort: 443 - livenessProbe: - failureThreshold: 3 - httpGet: - path: /healthz - port: 10254 - scheme: HTTP - initialDelaySeconds: 10 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 10 - readinessProbe: - failureThreshold: 3 - httpGet: - path: /healthz - port: 10254 - scheme: HTTP - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 10 - ---- - -kind: Service -apiVersion: v1 -metadata: - name: ingress-nginx - namespace: ingress-nginx - labels: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx -spec: - externalTrafficPolicy: Local - type: LoadBalancer - selector: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx - ports: - - name: http - port: 80 - targetPort: http - - name: https - port: 443 - targetPort: https - ---- diff --git a/examples/k8s/zipkin.yaml b/examples/k8s/zipkin.yaml index e6770d1a4cf..2da2f614fa2 100644 --- a/examples/k8s/zipkin.yaml +++ b/examples/k8s/zipkin.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2019-2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,13 +14,16 @@ # limitations under the License. # -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: zipkin labels: app: zipkin spec: + selector: + matchLabels: + app: zipkin replicas: 1 template: metadata: @@ -28,12 +31,11 @@ spec: app: zipkin spec: containers: - - image: openzipkin/zipkin:2 - imagePullPolicy: Always - name: zipkin - ports: - - containerPort: 9411 - restartPolicy: Always + - name: zipkin + image: openzipkin/zipkin:2 + imagePullPolicy: Always + ports: + - containerPort: 9411 --- apiVersion: v1 @@ -53,16 +55,19 @@ spec: --- -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: zipkin-ingress spec: rules: - - host: localhost - http: - paths: - - path: /zipkin - backend: - serviceName: zipkin - servicePort: 9411 + - host: localhost + http: + paths: + - path: /zipkin + pathType: Prefix + backend: + service: + name: zipkin + port: + number: 9411 diff --git a/examples/quickstarts/helidon-quickstart-mp/app.yaml b/examples/quickstarts/helidon-quickstart-mp/app.yaml index 58099afcf00..16dd9668e41 100644 --- a/examples/quickstarts/helidon-quickstart-mp/app.yaml +++ b/examples/quickstarts/helidon-quickstart-mp/app.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,12 +29,20 @@ spec: targetPort: 8080 name: http --- + +apiVersion: apps/v1 kind: Deployment -apiVersion: extensions/v1beta1 metadata: name: helidon-quickstart-mp + labels: + app: helidon-quickstart-mp + version: v1 spec: replicas: 1 + selector: + matchLabels: + app: helidon-quickstart-mp + version: v1 template: metadata: labels: @@ -42,9 +50,8 @@ spec: version: v1 spec: containers: - - name: helidon-quickstart-mp - image: helidon-quickstart-mp - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 ---- + - name: helidon-quickstart-mp + image: helidon-quickstart-mp + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 diff --git a/examples/quickstarts/helidon-quickstart-se/app.yaml b/examples/quickstarts/helidon-quickstart-se/app.yaml index 7b84daac617..e5aa643c878 100644 --- a/examples/quickstarts/helidon-quickstart-se/app.yaml +++ b/examples/quickstarts/helidon-quickstart-se/app.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,12 +29,20 @@ spec: targetPort: 8080 name: http --- + +apiVersion: apps/v1 kind: Deployment -apiVersion: extensions/v1beta1 metadata: name: helidon-quickstart-se + labels: + app: helidon-quickstart-se + version: v1 spec: replicas: 1 + selector: + matchLabels: + app: helidon-quickstart-se + version: v1 template: metadata: labels: @@ -42,9 +50,8 @@ spec: version: v1 spec: containers: - - name: helidon-quickstart-se - image: helidon-quickstart-se - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 ---- + - name: helidon-quickstart-se + image: helidon-quickstart-se + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 diff --git a/examples/quickstarts/helidon-standalone-quickstart-mp/app.yaml b/examples/quickstarts/helidon-standalone-quickstart-mp/app.yaml index 960765b884c..7d330579c02 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-mp/app.yaml +++ b/examples/quickstarts/helidon-standalone-quickstart-mp/app.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,34 +17,41 @@ kind: Service apiVersion: v1 metadata: - name: helidon-standalone-quickstart-mp + name: helidon-quickstart-mp labels: - app: helidon-standalone-quickstart-mp + app: helidon-quickstart-mp spec: type: NodePort selector: - app: helidon-standalone-quickstart-mp + app: helidon-quickstart-mp ports: - - port: 8080 - targetPort: 8080 - name: http + - port: 8080 + targetPort: 8080 + name: http --- + +apiVersion: apps/v1 kind: Deployment -apiVersion: extensions/v1beta1 metadata: - name: helidon-standalone-quickstart-mp + name: helidon-quickstart-mp + labels: + app: helidon-quickstart-mp + version: v1 spec: replicas: 1 + selector: + matchLabels: + app: helidon-quickstart-mp + version: v1 template: metadata: labels: - app: helidon-standalone-quickstart-mp + app: helidon-quickstart-mp version: v1 spec: containers: - - name: helidon-standalone-quickstart-mp - image: helidon-standalone-quickstart-mp - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 ---- + - name: helidon-quickstart-mp + image: helidon-quickstart-mp + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 diff --git a/examples/quickstarts/helidon-standalone-quickstart-se/app.yaml b/examples/quickstarts/helidon-standalone-quickstart-se/app.yaml index 44709c4c7b4..00fdab888f6 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-se/app.yaml +++ b/examples/quickstarts/helidon-standalone-quickstart-se/app.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,34 +17,41 @@ kind: Service apiVersion: v1 metadata: - name: helidon-standalone-quickstart-se + name: helidon-quickstart-se labels: - app: helidon-standalone-quickstart-se + app: helidon-quickstart-se spec: type: NodePort selector: - app: helidon-standalone-quickstart-se + app: helidon-quickstart-se ports: - - port: 8080 - targetPort: 8080 - name: http + - port: 8080 + targetPort: 8080 + name: http --- + +apiVersion: apps/v1 kind: Deployment -apiVersion: extensions/v1beta1 metadata: - name: helidon-standalone-quickstart-se + name: helidon-quickstart-se + labels: + app: helidon-quickstart-se + version: v1 spec: replicas: 1 + selector: + matchLabels: + app: helidon-quickstart-se + version: v1 template: metadata: labels: - app: helidon-standalone-quickstart-se + app: helidon-quickstart-se version: v1 spec: containers: - - name: helidon-standalone-quickstart-se - image: helidon-standalone-quickstart-se - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 ---- + - name: helidon-quickstart-se + image: helidon-quickstart-se + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 diff --git a/examples/todo-app/README.md b/examples/todo-app/README.md index e4d00ad497d..d012398ac2d 100644 --- a/examples/todo-app/README.md +++ b/examples/todo-app/README.md @@ -25,7 +25,9 @@ docker run --name zipkin -d -p 9411:9411 openzipkin/zipkin With Kubernetes: ```bash -kubectl apply -f ../k8s/ingress.yaml -f ../k8s/zipkin.yaml +kubectl apply \ + -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/ingress-nginx-3.15.2/deploy/static/provider/cloud/deploy.yaml \ + -f ../k8s/zipkin.yaml ``` ## Build and run @@ -76,8 +78,6 @@ docker stop zipkin \ Delete the Kubernetes resources: ```bash kubectl delete \ - -f ../k8s/ingress.yaml \ - -f ../k8s/zipkin.yaml \ -f cassandra.yaml \ -f backend/app.yaml \ -f frontend/app.yaml diff --git a/examples/todo-app/backend/app.yaml b/examples/todo-app/backend/app.yaml index 47291eb435c..8cccee662d0 100644 --- a/examples/todo-app/backend/app.yaml +++ b/examples/todo-app/backend/app.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2019-2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,10 +30,12 @@ data: --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: helidon-examples-todo-backend + labels: + app: helidon-examples-todo-backend spec: replicas: 1 template: @@ -42,18 +44,18 @@ spec: app: helidon-examples-todo-backend spec: containers: - - name: helidon-examples-todo-backend - image: helidon-examples-todo-backend - imagePullPolicy: Never - ports: - - containerPort: 8854 - volumeMounts: - - name: config-volume - mountPath: /conf + - name: helidon-examples-todo-backend + image: helidon-examples-todo-backend + imagePullPolicy: Never + ports: + - containerPort: 8854 + volumeMounts: + - mountPath: /conf + name: config-volume volumes: - - name: config-volume - configMap: - name: helidon-examples-todo-backend + - name: config-volume + configMap: + name: helidon-examples-todo-backend --- diff --git a/examples/todo-app/cassandra.yaml b/examples/todo-app/cassandra.yaml index c64802396bf..8f4d2cead0b 100644 --- a/examples/todo-app/cassandra.yaml +++ b/examples/todo-app/cassandra.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2019-2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,20 +29,26 @@ spec: --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: helidon-examples-todo-cassandra + labels: + app: helidon-examples-todo-cassandra spec: replicas: 1 + selector: + matchLabels: + app: helidon-examples-todo-cassandra template: metadata: labels: app: helidon-examples-todo-cassandra spec: containers: - - name: todo-cassandra-container - image: helidon-examples-todo-cassandra - imagePullPolicy: Never - ports: - - containerPort: 9042 + - name: todo-cassandra-container + image: helidon-examples-todo-cassandra + imagePullPolicy: Never + ports: + - containerPort: 9042 + restartPolicy: Always diff --git a/examples/todo-app/frontend/app.yaml b/examples/todo-app/frontend/app.yaml index d0d8e9963fd..c7c1f59d313 100644 --- a/examples/todo-app/frontend/app.yaml +++ b/examples/todo-app/frontend/app.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2019-2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -26,10 +26,12 @@ data: backend.endpoint: http://helidon-examples-todo-backend:8854 --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: helidon-examples-todo-frontend + labels: + app: helidon-examples-todo-frontend spec: replicas: 1 template: @@ -38,18 +40,18 @@ spec: app: helidon-examples-todo-frontend spec: containers: - - name: helidon-examples-todo-frontend - image: helidon-examples-todo-frontend - imagePullPolicy: Never - ports: - - containerPort: 8080 - volumeMounts: - - name: config-volume - mountPath: /conf - volumes: - - name: config-volume - configMap: + - image: helidon-examples-todo-frontend + imagePullPolicy: Never name: helidon-examples-todo-frontend + ports: + - containerPort: 8080 + volumeMounts: + - mountPath: /conf + name: config-volume + volumes: + - name: config-volume + configMap: + name: helidon-examples-todo-frontend --- @@ -67,18 +69,21 @@ spec: sessionAffinity: None --- -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: + name: helidon-examples-todo-frontend annotations: nginx.ingress.kubernetes.io/rewrite-target: /$1 - name: helidon-examples-todo-frontend spec: rules: - - host: localhost - http: - paths: - - path: /todo/(.*) - backend: - serviceName: helidon-examples-todo-frontend - servicePort: 8080 \ No newline at end of file + - host: localhost + http: + paths: + - path: /todo/(.*) + pathType: Prefix + backend: + service: + name: helidon-examples-todo-frontend + port: + number: 8080 diff --git a/examples/translator-app/README.md b/examples/translator-app/README.md index f5fcfb21de9..1a5f18afdbf 100644 --- a/examples/translator-app/README.md +++ b/examples/translator-app/README.md @@ -18,7 +18,9 @@ java -jar zipkin.jar With Kubernetes: ```bash -kubectl apply -f ../k8s/ingress.yaml -f ../k8s/zipkin.yaml +kubectl apply \ + -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/ingress-nginx-3.15.2/deploy/static/provider/cloud/deploy.yaml \ + -f ../k8s/zipkin.yaml ``` ## Build and run diff --git a/examples/translator-app/backend/app.yaml b/examples/translator-app/backend/app.yaml index 33be877c8b5..8b5b06b3389 100644 --- a/examples/translator-app/backend/app.yaml +++ b/examples/translator-app/backend/app.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # limitations under the License. # -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: helidon-examples-translator-backend @@ -28,15 +28,14 @@ spec: app: helidon-examples-translator-backend spec: containers: - - image: helidon-examples-translator-backend:latest - imagePullPolicy: IfNotPresent - name: helidon-examples-translator-backend - ports: - - containerPort: 9080 - env: - - name: tracing.host - value: "zipkin" - restartPolicy: Always + - name: helidon-examples-translator-backend + image: helidon-examples-translator-backend:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 9080 + env: + - name: tracing.host + value: zipkin --- apiVersion: v1 diff --git a/examples/translator-app/frontend/app.yaml b/examples/translator-app/frontend/app.yaml index b24f1639adf..c9359dd25b2 100644 --- a/examples/translator-app/frontend/app.yaml +++ b/examples/translator-app/frontend/app.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2021 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,8 +14,7 @@ # limitations under the License. # - -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: helidon-examples-translator-frontend @@ -29,17 +28,17 @@ spec: app: helidon-examples-translator-frontend spec: containers: - - image: helidon-examples-translator-frontend:latest - imagePullPolicy: IfNotPresent - name: translator-frontend - ports: - - containerPort: 8080 - env: - - name: tracing.host - value: "zipkin" - - name: backend.host - value: "helidon-examples-translator-backend" - restartPolicy: Always + - name: translator-frontend + image: helidon-examples-translator-frontend:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 + env: + - name: tracing.host + value: zipkin + - name: backend.host + value: helidon-examples-translator-backend + --- apiVersion: v1 @@ -59,16 +58,19 @@ spec: --- -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: helidon-examples-translator-frontend spec: rules: - - host: localhost - http: - paths: - - path: /translator - backend: - serviceName: helidon-examples-translator-frontend - servicePort: 8080 \ No newline at end of file + - host: localhost + http: + paths: + - path: /translator + pathType: Prefix + backend: + service: + name: helidon-examples-translator-frontend + port: + number: 8080