Skip to content

Commit

Permalink
Update k8s descriptors to avoid using deprecated APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
romain-grecourt committed Feb 2, 2021
1 parent 34bbad1 commit 38449cc
Show file tree
Hide file tree
Showing 19 changed files with 302 additions and 542 deletions.
17 changes: 8 additions & 9 deletions examples/employee-app/app.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -29,8 +29,8 @@ spec:
targetPort: 8080
name: http
---
apiVersion: apps/v1
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: helidon-examples-employee-app
spec:
Expand All @@ -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
Expand All @@ -60,5 +60,4 @@ spec:
- port: 80
targetPort: 8080
selector:
app: helidon-examples-employee-app

app: helidon-examples-employee-app
6 changes: 4 additions & 2 deletions examples/integrations/cdi/jedis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
```
48 changes: 28 additions & 20 deletions examples/integrations/cdi/jedis/app.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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:
Expand All @@ -51,19 +54,24 @@ 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
annotations:
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
- host: localhost
http:
paths:
- path: /helidon-cdi-jedis/(.*)
pathType: Prefix
backend:
service:
name: helidon-examples-integrations-cdi-jedis
port:
number: 8080
16 changes: 9 additions & 7 deletions examples/integrations/cdi/jedis/redis.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -29,10 +29,12 @@ spec:

---

apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
labels:
app: redis
spec:
replicas: 1
template:
Expand All @@ -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
6 changes: 4 additions & 2 deletions examples/integrations/cdi/oci-objectstorage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
```
109 changes: 57 additions & 52 deletions examples/integrations/cdi/oci-objectstorage/app.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -83,20 +84,24 @@ 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
annotations:
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
- host: localhost
http:
paths:
- path: /oci-objectstorage/(.*)
pathType: Prefix
backend:
service:
name: helidon-examples-integrations-cdi-oci-objectstorage
port:
number: 8080
Loading

0 comments on commit 38449cc

Please sign in to comment.