From ea04602b6ab91137a42a592a2ed97c9a0820abc2 Mon Sep 17 00:00:00 2001 From: Aimee Ukasick Date: Tue, 3 Jan 2023 12:16:27 -0600 Subject: [PATCH 1/2] docs(istio): draft files for tutorial --- cleanup.sh | 85 +++++++++ deploy-webhook.yml | 109 ------------ deploy.yml | 103 +++-------- manifests/bookinfo.yaml | 343 ++++++++++++++++++++++++++++++++++++ manifests/istio-config.yaml | 103 +++++++++++ manifests/reviews-v1.yaml | 260 +++++++++++++++++++++++++++ manifests/reviews-v2.yaml | 80 +++++++++ manifests/reviews-v3.yaml | 81 +++++++++ manifests/sample-app.yml | 71 -------- 9 files changed, 974 insertions(+), 261 deletions(-) create mode 100755 cleanup.sh delete mode 100644 deploy-webhook.yml create mode 100644 manifests/bookinfo.yaml create mode 100644 manifests/istio-config.yaml create mode 100644 manifests/reviews-v1.yaml create mode 100644 manifests/reviews-v2.yaml create mode 100644 manifests/reviews-v3.yaml delete mode 100644 manifests/sample-app.yml diff --git a/cleanup.sh b/cleanup.sh new file mode 100755 index 0000000..2db0d3e --- /dev/null +++ b/cleanup.sh @@ -0,0 +1,85 @@ +#!/bin/bash +# +# Copyright Istio Authors +# +# 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. + +SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + +# only ask if in interactive mode +if [[ -t 0 && -z ${NAMESPACE} ]];then + echo -n "namespace ? [default] " + read -r NAMESPACE +fi + +# verify if the namespace exists, otherwise use default namespace +if [[ -n ${NAMESPACE} ]];then + ns=$(kubectl get namespace "${NAMESPACE}" --no-headers --output=go-template="{{.metadata.name}}" 2>/dev/null) + if [[ -z ${ns} ]];then + echo "NAMESPACE ${NAMESPACE} not found." + NAMESPACE=default + fi +fi + +# if no namespace is provided, use default namespace +if [[ -z ${NAMESPACE} ]];then + NAMESPACE=default +fi + +echo "using NAMESPACE=${NAMESPACE}" + +# clean up Istio traffic management resources that may have been used +protos=( destinationrules virtualservices gateways ) +for proto in "${protos[@]}"; do + for resource in $(kubectl get -n ${NAMESPACE} "$proto" -o name); do + kubectl delete -n ${NAMESPACE} "$resource"; + done +done + +# clean up Gateway API resources that may have been used +if kubectl get crd gateways.gateway.networking.k8s.io >/dev/null 2>&1; then + protos=( httproutes gateways.gateway.networking.k8s.io ) + for proto in "${protos[@]}"; do + for resource in $(kubectl get -n ${NAMESPACE} "$proto" -o name); do + kubectl delete -n ${NAMESPACE} "$resource"; + done + done + kubectl delete -n ${NAMESPACE} -f "$SCRIPTDIR/bookinfo-versions.yaml" >/dev/null 2>&1 +fi + +OUTPUT=$(mktemp) +export OUTPUT +echo "Application cleanup may take up to one minute" +kubectl delete -n ${NAMESPACE} -f "$SCRIPTDIR/bookinfo.yaml" > "${OUTPUT}" 2>&1 +ret=$? +function cleanup() { + rm -f "${OUTPUT}" +} + +trap cleanup EXIT + +if [[ ${ret} -eq 0 ]];then + cat "${OUTPUT}" +else + # ignore NotFound errors + OUT2=$(grep -v NotFound "${OUTPUT}") + if [[ -n ${OUT2} ]];then + cat "${OUTPUT}" + exit ${ret} + fi +fi + +# wait for 30 sec for bookinfo to clean up +sleep 30 + +echo "Application cleanup successful" diff --git a/deploy-webhook.yml b/deploy-webhook.yml deleted file mode 100644 index 30f92ae..0000000 --- a/deploy-webhook.yml +++ /dev/null @@ -1,109 +0,0 @@ ---- -version: v1 -kind: kubernetes -application: cdaas-sample-app -# Map of Deployment Targets, this is set up in a way where -# we can do multi-target deployments (multi-region or multi-cluster) -targets: - # This in the name of a deployment. Underneath it is its configuration. - test: - # the agentIdentifier of the Remote Network Agent for this target - account: sample-rna-test-cluster - # Optionally override the namespaces that are in the manifests - namespace: sample-test - # This is the key to a strategy under the strategies map - strategy: rolling - staging: - # the agentIdentifier of the Remote Network Agent for this target - account: sample-rna-staging-cluster - # Optionally override the namespaces that are in the manifests - namespace: sample-staging - # This is the key to a strategy under the strategies map - strategy: rolling - constraints: - dependsOn: ["test"] - afterDeployment: - - runWebhook: - name: basicPing - prod-eu: - # the agentIdentifier of the Remote Network Agent for this target - account: sample-rna-prod-eu-cluster - # Optionally override the namespaces that are in the manifests - namespace: sample-prod-eu - # This is the key to a strategy under the strategies map - strategy: mybluegreen - constraints: - dependsOn: ["staging"] - prod-us: - # the agentIdentifier of the Remote Network Agent for this target - account: sample-rna-prod-us-cluster - # Optionally override the namespaces that are in the manifests - namespace: sample-prod-us - # This is the key to a strategy under the strategies map - strategy: mycanary - constraints: - dependsOn: ["staging"] -# The list of manifests sources -manifests: - # This reads all YAML files in a dir - # and deploys manifests in that dir to all targets. - - path: manifests/sample-app.yml -# The map of strategies, a deployment target will reference one of these -strategies: - # this is the name for the strategy - mycanary: - # This map key is the deployment strategy type - canary: - steps: - # The map key is the step type - - setWeight: - weight: 25 - - pause: - duration: 10 - unit: seconds - - setWeight: - weight: 50 - - pause: - duration: 10 - unit: seconds - - setWeight: - weight: 100 - rolling: - canary: - steps: - - setWeight: - weight: 100 - mybluegreen: - # This specifies the deployment strategy type - blueGreen: - activeService: cdaas-sample-app-svc - # List of what needs to happen before redirecting traffic - redirectTrafficAfter: - - pause: - duration: 10 - unit: seconds - # List of what needs to happen before shutting down the old version - shutDownOldVersionAfter: - - pause: - duration: 15 - unit: seconds - -webhooks: - - name: basicPing - method: POST - uriTemplate: https://api.github.com/repos/{{secrets.github_org}}/{{secrets.github_repo}}/dispatches - networkMode: direct - headers: - - key: Authorization - value: token {{secrets.github_personal_access_token}} - - key: Content-Type - value: application/json - bodyTemplate: - inline: >- - { - "event_type": "basicPing", - "client_payload": { - "callbackUri": "{{armory.callbackUri}}/callback" - } - } - retryCount: 1 diff --git a/deploy.yml b/deploy.yml index efb1474..d404b3d 100644 --- a/deploy.yml +++ b/deploy.yml @@ -1,93 +1,34 @@ --- +# deployment.yaml version: v1 kind: kubernetes -application: cdaas-sample-app -# Map of Deployment Targets, this is set up in a way where -# we can do multi-target deployments (multi-region or multi-cluster) +application: reviews targets: - # This in the name of a deployment. Underneath it is its configuration. - test: - # the agentIdentifier of the Remote Network Agent for this target - account: sample-rna-test-cluster - # Optionally override the namespaces that are in the manifests - namespace: sample-test - # This is the key to a strategy under the strategies map - strategy: rolling - staging: - # the agentIdentifier of the Remote Network Agent for this target - account: sample-rna-staging-cluster - # Optionally override the namespaces that are in the manifests - namespace: sample-staging - # This is the key to a strategy under the strategies map - strategy: rolling - constraints: - dependsOn: ["test"] - beforeDeployment: [] - prod-eu: - # the agentIdentifier of the Remote Network Agent for this target - account: sample-rna-prod-eu-cluster - # Optionally override the namespaces that are in the manifests - namespace: sample-prod-eu - # This is the key to a strategy under the strategies map - strategy: mybluegreen - constraints: - dependsOn: ["staging"] - beforeDeployment: - - pause: - untilApproved: true - prod-us: - # the agentIdentifier of the Remote Network Agent for this target - account: sample-rna-prod-us-cluster - # Optionally override the namespaces that are in the manifests - namespace: sample-prod-us - # This is the key to a strategy under the strategies map - strategy: mycanary - constraints: - dependsOn: ["staging"] - beforeDeployment: - - pause: - untilApproved: true -# The list of manifests sources + dev: + account: aimeeu-local + namespace: istiodemo + strategy: strategy1 manifests: - # This reads all YAML files in a dir - # and deploys manifests in that dir to all targets. - - path: manifests/sample-app.yml -# The map of strategies, a deployment target will reference one of these + - path: manifests/reviews-v1.yaml strategies: - # this is the name for the strategy - mycanary: - # This map key is the deployment strategy type + strategy1: canary: steps: - # The map key is the step type - - setWeight: - weight: 25 - - pause: - duration: 10 - unit: seconds - setWeight: - weight: 50 + weight: 10 - pause: - duration: 10 - unit: seconds - - setWeight: - weight: 100 - rolling: - canary: - steps: + untilApproved: true - setWeight: - weight: 100 - mybluegreen: - # This specifies the deployment strategy type - blueGreen: - activeService: cdaas-sample-app-svc - # List of what needs to happen before redirecting traffic - redirectTrafficAfter: - - pause: - duration: 10 - unit: seconds - # List of what needs to happen before shutting down the old version - shutDownOldVersionAfter: + weight: 57 - pause: - duration: 20 - unit: seconds + untilApproved: true +trafficManagement: + - targets: ["dev"] + istio: + - virtualService: + name: reviews-route # virtualService.metadata.name + httpRouteName: reviews-http-route # virtualService.http.route[].name abstraction + destinationRule: # OPTIONAL (if only one destination exists on the service) virtualService.http.route[].destination/destinationRule abstraction + name: reviews-destination #destinationRule.metadata.name + activeSubsetName: stable # OPTIONAL (if only 1 active subset on DR)- virtualService.http.route[].destinations[0].subset + canarySubsetName: canary diff --git a/manifests/bookinfo.yaml b/manifests/bookinfo.yaml new file mode 100644 index 0000000..1ef7204 --- /dev/null +++ b/manifests/bookinfo.yaml @@ -0,0 +1,343 @@ +# Copyright Istio Authors +# +# 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. + +################################################################################################## +# This file defines the services, service accounts, and deployments for the Bookinfo sample. +# +# To apply all 4 Bookinfo services, their corresponding service accounts, and deployments: +# +# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml +# +# Alternatively, you can deploy any resource separately: +# +# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml -l service=reviews # reviews Service +# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml -l account=reviews # reviews ServiceAccount +# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml -l app=reviews,version=v3 # reviews-v3 Deployment +################################################################################################## + +################################################################################################## +# Details service +################################################################################################## +apiVersion: v1 +kind: Service +metadata: + name: details + labels: + app: details + service: details +spec: + ports: + - port: 9080 + name: http + selector: + app: details +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: bookinfo-details + labels: + account: details +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: details-v1 + labels: + app: details + version: v1 +spec: + replicas: 1 + selector: + matchLabels: + app: details + version: v1 + template: + metadata: + labels: + app: details + version: v1 + spec: + serviceAccountName: bookinfo-details + containers: + - name: details + image: docker.io/istio/examples-bookinfo-details-v1:1.17.0 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 9080 + securityContext: + runAsUser: 1000 +--- +################################################################################################## +# Ratings service +################################################################################################## +apiVersion: v1 +kind: Service +metadata: + name: ratings + labels: + app: ratings + service: ratings +spec: + ports: + - port: 9080 + name: http + selector: + app: ratings +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: bookinfo-ratings + labels: + account: ratings +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ratings-v1 + labels: + app: ratings + version: v1 +spec: + replicas: 1 + selector: + matchLabels: + app: ratings + version: v1 + template: + metadata: + labels: + app: ratings + version: v1 + spec: + serviceAccountName: bookinfo-ratings + containers: + - name: ratings + image: docker.io/istio/examples-bookinfo-ratings-v1:1.17.0 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 9080 + securityContext: + runAsUser: 1000 +--- +################################################################################################## +# Reviews service +################################################################################################## +apiVersion: v1 +kind: Service +metadata: + name: reviews + labels: + app: reviews + service: reviews +spec: + ports: + - port: 9080 + name: http + selector: + app: reviews +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: bookinfo-reviews + labels: + account: reviews +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: reviews-v1 + labels: + app: reviews + version: v1 +spec: + replicas: 1 + selector: + matchLabels: + app: reviews + version: v1 + template: + metadata: + labels: + app: reviews + version: v1 + spec: + serviceAccountName: bookinfo-reviews + containers: + - name: reviews + image: docker.io/istio/examples-bookinfo-reviews-v1:1.17.0 + imagePullPolicy: IfNotPresent + env: + - name: LOG_DIR + value: "/tmp/logs" + ports: + - containerPort: 9080 + volumeMounts: + - name: tmp + mountPath: /tmp + - name: wlp-output + mountPath: /opt/ibm/wlp/output + securityContext: + runAsUser: 1000 + volumes: + - name: wlp-output + emptyDir: {} + - name: tmp + emptyDir: {} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: reviews-v2 + labels: + app: reviews + version: v2 +spec: + replicas: 1 + selector: + matchLabels: + app: reviews + version: v2 + template: + metadata: + labels: + app: reviews + version: v2 + spec: + serviceAccountName: bookinfo-reviews + containers: + - name: reviews + image: docker.io/istio/examples-bookinfo-reviews-v2:1.17.0 + imagePullPolicy: IfNotPresent + env: + - name: LOG_DIR + value: "/tmp/logs" + ports: + - containerPort: 9080 + volumeMounts: + - name: tmp + mountPath: /tmp + - name: wlp-output + mountPath: /opt/ibm/wlp/output + securityContext: + runAsUser: 1000 + volumes: + - name: wlp-output + emptyDir: {} + - name: tmp + emptyDir: {} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: reviews-v3 + labels: + app: reviews + version: v3 +spec: + replicas: 1 + selector: + matchLabels: + app: reviews + version: v3 + template: + metadata: + labels: + app: reviews + version: v3 + spec: + serviceAccountName: bookinfo-reviews + containers: + - name: reviews + image: docker.io/istio/examples-bookinfo-reviews-v3:1.17.0 + imagePullPolicy: IfNotPresent + env: + - name: LOG_DIR + value: "/tmp/logs" + ports: + - containerPort: 9080 + volumeMounts: + - name: tmp + mountPath: /tmp + - name: wlp-output + mountPath: /opt/ibm/wlp/output + securityContext: + runAsUser: 1000 + volumes: + - name: wlp-output + emptyDir: {} + - name: tmp + emptyDir: {} +--- +################################################################################################## +# Productpage services +################################################################################################## +apiVersion: v1 +kind: Service +metadata: + name: productpage + labels: + app: productpage + service: productpage +spec: + ports: + - port: 9080 + name: http + selector: + app: productpage +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: bookinfo-productpage + labels: + account: productpage +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: productpage-v1 + labels: + app: productpage + version: v1 +spec: + replicas: 1 + selector: + matchLabels: + app: productpage + version: v1 + template: + metadata: + labels: + app: productpage + version: v1 + spec: + serviceAccountName: bookinfo-productpage + containers: + - name: productpage + image: docker.io/istio/examples-bookinfo-productpage-v1:1.17.0 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 9080 + volumeMounts: + - name: tmp + mountPath: /tmp + securityContext: + runAsUser: 1000 + volumes: + - name: tmp + emptyDir: {} +--- diff --git a/manifests/istio-config.yaml b/manifests/istio-config.yaml new file mode 100644 index 0000000..985074e --- /dev/null +++ b/manifests/istio-config.yaml @@ -0,0 +1,103 @@ +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: reviews-route +spec: + hosts: + - reviews.istiodemo.svc.cluster.local + http: + - route: + - destination: + host: reviews.istiodemo.svc.cluster.local + subset: stable + name: reviews-http-route +--- +apiVersion: networking.istio.io/v1alpha3 +kind: DestinationRule +metadata: + name: reviews-destination +spec: + host: reviews.istiodemo.svc.cluster.local + subsets: + - name: stable + labels: + app: reviews +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: productpage-route +spec: + hosts: + - productpage.istiodemo.svc.cluster.local + http: + - route: + - destination: + host: productpage.istiodemo.svc.cluster.local + subset: v1 + name: productpage-http-route +--- +apiVersion: networking.istio.io/v1alpha3 +kind: DestinationRule +metadata: + name: productpage-destination +spec: + host: productpage + subsets: + - name: v1 + labels: + app: productpage + version: v1 +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: ratings-route +spec: + hosts: + - ratings.istiodemo.svc.cluster.local + http: + - route: + - destination: + host: ratings.istiodemo.svc.cluster.local + subset: v1 +--- +apiVersion: networking.istio.io/v1alpha3 +kind: DestinationRule +metadata: + name: ratings-destination +spec: + host: ratings.istiodemo.svc.cluster.local + subsets: + - name: v1 + labels: + app: ratings + version: v1 +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: details-route +spec: + hosts: + - details.istiodemo.svc.cluster.local + http: + - route: + - destination: + host: details.istiodemo.svc.cluster.local + subset: v1 + name: details-http-route +--- +apiVersion: networking.istio.io/v1alpha3 +kind: DestinationRule +metadata: + name: details-destination +spec: + host: details.istiodemo.svc.cluster.local + subsets: + - name: v1 + labels: + app: details + version: v1 +--- + diff --git a/manifests/reviews-v1.yaml b/manifests/reviews-v1.yaml new file mode 100644 index 0000000..fd13c9c --- /dev/null +++ b/manifests/reviews-v1.yaml @@ -0,0 +1,260 @@ +# Copyright Istio Authors +# +# 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. + +################################################################################################## +# This file defines the services, service accounts, and deployments for the Bookinfo sample. +# +# To apply all 4 Bookinfo services, their corresponding service accounts, and deployments: +# +# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml +# +# Alternatively, you can deploy any resource separately: +# +# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml -l service=reviews # reviews Service +# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml -l account=reviews # reviews ServiceAccount +# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml -l app=reviews,version=v3 # reviews-v3 Deployment +################################################################################################## + +################################################################################################## +# Details service +################################################################################################## +apiVersion: v1 +kind: Service +metadata: + name: details + labels: + app: details + service: details +spec: + ports: + - port: 9080 + name: http + selector: + app: details +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: bookinfo-details + labels: + account: details +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: details-v1 + labels: + app: details + version: v1 +spec: + replicas: 1 + selector: + matchLabels: + app: details + version: v1 + template: + metadata: + labels: + app: details + version: v1 + spec: + serviceAccountName: bookinfo-details + containers: + - name: details + image: docker.io/istio/examples-bookinfo-details-v1:1.17.0 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 9080 + securityContext: + runAsUser: 1000 +--- +################################################################################################## +# Ratings service +################################################################################################## +apiVersion: v1 +kind: Service +metadata: + name: ratings + labels: + app: ratings + service: ratings +spec: + ports: + - port: 9080 + name: http + selector: + app: ratings +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: bookinfo-ratings + labels: + account: ratings +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ratings-v1 + labels: + app: ratings + version: v1 +spec: + replicas: 1 + selector: + matchLabels: + app: ratings + version: v1 + template: + metadata: + labels: + app: ratings + version: v1 + spec: + serviceAccountName: bookinfo-ratings + containers: + - name: ratings + image: docker.io/istio/examples-bookinfo-ratings-v1:1.17.0 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 9080 + securityContext: + runAsUser: 1000 +--- +################################################################################################## +# Reviews service v1 +################################################################################################## +apiVersion: v1 +kind: Service +metadata: + name: reviews + labels: + app: reviews + service: reviews +spec: + ports: + - port: 9080 + name: http + selector: + app: reviews +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: bookinfo-reviews + labels: + account: reviews +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: reviews + labels: + app: reviews + version: v1 +spec: + replicas: 1 + selector: + matchLabels: + app: reviews + version: v1 + template: + metadata: + labels: + app: reviews + version: v1 + spec: + serviceAccountName: bookinfo-reviews + containers: + - name: reviews + image: docker.io/istio/examples-bookinfo-reviews-v1:1.17.0 + imagePullPolicy: IfNotPresent + env: + - name: LOG_DIR + value: "/tmp/logs" + ports: + - containerPort: 9080 + volumeMounts: + - name: tmp + mountPath: /tmp + - name: wlp-output + mountPath: /opt/ibm/wlp/output + securityContext: + runAsUser: 1000 + volumes: + - name: wlp-output + emptyDir: {} + - name: tmp + emptyDir: {} +--- +################################################################################################## +# Productpage services +################################################################################################## +apiVersion: v1 +kind: Service +metadata: + name: productpage + labels: + app: productpage + service: productpage +spec: + ports: + - port: 9080 + name: http + selector: + app: productpage +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: bookinfo-productpage + labels: + account: productpage +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: productpage-v1 + labels: + app: productpage + version: v1 +spec: + replicas: 1 + selector: + matchLabels: + app: productpage + version: v1 + template: + metadata: + labels: + app: productpage + version: v1 + spec: + serviceAccountName: bookinfo-productpage + containers: + - name: productpage + image: docker.io/istio/examples-bookinfo-productpage-v1:1.17.0 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 9080 + volumeMounts: + - name: tmp + mountPath: /tmp + securityContext: + runAsUser: 1000 + volumes: + - name: tmp + emptyDir: {} +--- + diff --git a/manifests/reviews-v2.yaml b/manifests/reviews-v2.yaml new file mode 100644 index 0000000..a7cfbbc --- /dev/null +++ b/manifests/reviews-v2.yaml @@ -0,0 +1,80 @@ +# Copyright Istio Authors +# +# 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. + +################################################################################################## +# Reviews service +################################################################################################## +apiVersion: v1 +kind: Service +metadata: + name: reviews + labels: + app: reviews + service: reviews +spec: + ports: + - port: 9080 + name: http + selector: + app: reviews +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: bookinfo-reviews + labels: + account: reviews +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: reviews + labels: + app: reviews + version: v2 +spec: + replicas: 1 + selector: + matchLabels: + app: reviews + version: v2 + template: + metadata: + labels: + app: reviews + version: v2 + spec: + serviceAccountName: bookinfo-reviews + containers: + - name: reviews + image: docker.io/istio/examples-bookinfo-reviews-v2:1.17.0 + imagePullPolicy: IfNotPresent + env: + - name: LOG_DIR + value: "/tmp/logs" + ports: + - containerPort: 9080 + volumeMounts: + - name: tmp + mountPath: /tmp + - name: wlp-output + mountPath: /opt/ibm/wlp/output + securityContext: + runAsUser: 1000 + volumes: + - name: wlp-output + emptyDir: {} + - name: tmp + emptyDir: {} +--- diff --git a/manifests/reviews-v3.yaml b/manifests/reviews-v3.yaml new file mode 100644 index 0000000..4421c3f --- /dev/null +++ b/manifests/reviews-v3.yaml @@ -0,0 +1,81 @@ +# Copyright Istio Authors +# +# 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. + +################################################################################################## +# Reviews service +################################################################################################## +apiVersion: v1 +kind: Service +metadata: + name: reviews + labels: + app: reviews + service: reviews +spec: + ports: + - port: 9080 + name: http + selector: + app: reviews +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: bookinfo-reviews + labels: + account: reviews +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: reviews + labels: + app: reviews + version: v3 +spec: + replicas: 1 + selector: + matchLabels: + app: reviews + version: v3 + template: + metadata: + labels: + app: reviews + version: v3 + spec: + serviceAccountName: bookinfo-reviews + containers: + - name: reviews + image: docker.io/istio/examples-bookinfo-reviews-v3:1.17.0 + imagePullPolicy: IfNotPresent + env: + - name: LOG_DIR + value: "/tmp/logs" + ports: + - containerPort: 9080 + volumeMounts: + - name: tmp + mountPath: /tmp + - name: wlp-output + mountPath: /opt/ibm/wlp/output + securityContext: + runAsUser: 1000 + volumes: + - name: wlp-output + emptyDir: {} + - name: tmp + emptyDir: {} +--- + diff --git a/manifests/sample-app.yml b/manifests/sample-app.yml deleted file mode 100644 index 082e5d3..0000000 --- a/manifests/sample-app.yml +++ /dev/null @@ -1,71 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: cdaas-sample-app - annotations: - "app": "cdaas-sample-app" -spec: - revisionHistoryLimit: 1 - replicas: 2 - strategy: - type: RollingUpdate - rollingUpdate: - maxSurge: 2 - maxUnavailable: 1 - selector: - matchLabels: - app: cdaas-sample-app - template: - metadata: - labels: - app: cdaas-sample-app - annotations: - "app": "cdaas-sample-app" - spec: - containers: - - image: demoimages/bluegreen:v3 #v5, v4, v3 - imagePullPolicy: Always - name: cdaas-sample-app - resources: - limits: - cpu: "100m" # this is to ensure the above busy wait cannot DOS a low CPU cluster. - memory: "70Mi" - requests: - cpu: "10m" # this is to ensure the above busy wait cannot DOS a low CPU cluster. - memory: "70Mi" - #ports: - # - containerPort: 8086 - restartPolicy: Always ---- - -apiVersion: v1 -kind: Service -metadata: - name: cdaas-sample-app-svc - labels: - app: cdaas-sample-app - annotations: - linkerd.io/inject: enabled -spec: - selector: - app: cdaas-sample-app - ports: - - name: http - port: 80 - targetPort: 8000 - protocol: TCP - - - - - - - - - - - - - - - From 6c9a518d4bfc483fe8d593fc23903a1a47aa2ccd Mon Sep 17 00:00:00 2001 From: Aimee Ukasick Date: Tue, 3 Jan 2023 12:19:42 -0600 Subject: [PATCH 2/2] remove bookinfo.yaml --- manifests/bookinfo.yaml | 343 ---------------------------------------- 1 file changed, 343 deletions(-) delete mode 100644 manifests/bookinfo.yaml diff --git a/manifests/bookinfo.yaml b/manifests/bookinfo.yaml deleted file mode 100644 index 1ef7204..0000000 --- a/manifests/bookinfo.yaml +++ /dev/null @@ -1,343 +0,0 @@ -# Copyright Istio Authors -# -# 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. - -################################################################################################## -# This file defines the services, service accounts, and deployments for the Bookinfo sample. -# -# To apply all 4 Bookinfo services, their corresponding service accounts, and deployments: -# -# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml -# -# Alternatively, you can deploy any resource separately: -# -# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml -l service=reviews # reviews Service -# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml -l account=reviews # reviews ServiceAccount -# kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml -l app=reviews,version=v3 # reviews-v3 Deployment -################################################################################################## - -################################################################################################## -# Details service -################################################################################################## -apiVersion: v1 -kind: Service -metadata: - name: details - labels: - app: details - service: details -spec: - ports: - - port: 9080 - name: http - selector: - app: details ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: bookinfo-details - labels: - account: details ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: details-v1 - labels: - app: details - version: v1 -spec: - replicas: 1 - selector: - matchLabels: - app: details - version: v1 - template: - metadata: - labels: - app: details - version: v1 - spec: - serviceAccountName: bookinfo-details - containers: - - name: details - image: docker.io/istio/examples-bookinfo-details-v1:1.17.0 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 9080 - securityContext: - runAsUser: 1000 ---- -################################################################################################## -# Ratings service -################################################################################################## -apiVersion: v1 -kind: Service -metadata: - name: ratings - labels: - app: ratings - service: ratings -spec: - ports: - - port: 9080 - name: http - selector: - app: ratings ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: bookinfo-ratings - labels: - account: ratings ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: ratings-v1 - labels: - app: ratings - version: v1 -spec: - replicas: 1 - selector: - matchLabels: - app: ratings - version: v1 - template: - metadata: - labels: - app: ratings - version: v1 - spec: - serviceAccountName: bookinfo-ratings - containers: - - name: ratings - image: docker.io/istio/examples-bookinfo-ratings-v1:1.17.0 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 9080 - securityContext: - runAsUser: 1000 ---- -################################################################################################## -# Reviews service -################################################################################################## -apiVersion: v1 -kind: Service -metadata: - name: reviews - labels: - app: reviews - service: reviews -spec: - ports: - - port: 9080 - name: http - selector: - app: reviews ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: bookinfo-reviews - labels: - account: reviews ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: reviews-v1 - labels: - app: reviews - version: v1 -spec: - replicas: 1 - selector: - matchLabels: - app: reviews - version: v1 - template: - metadata: - labels: - app: reviews - version: v1 - spec: - serviceAccountName: bookinfo-reviews - containers: - - name: reviews - image: docker.io/istio/examples-bookinfo-reviews-v1:1.17.0 - imagePullPolicy: IfNotPresent - env: - - name: LOG_DIR - value: "/tmp/logs" - ports: - - containerPort: 9080 - volumeMounts: - - name: tmp - mountPath: /tmp - - name: wlp-output - mountPath: /opt/ibm/wlp/output - securityContext: - runAsUser: 1000 - volumes: - - name: wlp-output - emptyDir: {} - - name: tmp - emptyDir: {} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: reviews-v2 - labels: - app: reviews - version: v2 -spec: - replicas: 1 - selector: - matchLabels: - app: reviews - version: v2 - template: - metadata: - labels: - app: reviews - version: v2 - spec: - serviceAccountName: bookinfo-reviews - containers: - - name: reviews - image: docker.io/istio/examples-bookinfo-reviews-v2:1.17.0 - imagePullPolicy: IfNotPresent - env: - - name: LOG_DIR - value: "/tmp/logs" - ports: - - containerPort: 9080 - volumeMounts: - - name: tmp - mountPath: /tmp - - name: wlp-output - mountPath: /opt/ibm/wlp/output - securityContext: - runAsUser: 1000 - volumes: - - name: wlp-output - emptyDir: {} - - name: tmp - emptyDir: {} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: reviews-v3 - labels: - app: reviews - version: v3 -spec: - replicas: 1 - selector: - matchLabels: - app: reviews - version: v3 - template: - metadata: - labels: - app: reviews - version: v3 - spec: - serviceAccountName: bookinfo-reviews - containers: - - name: reviews - image: docker.io/istio/examples-bookinfo-reviews-v3:1.17.0 - imagePullPolicy: IfNotPresent - env: - - name: LOG_DIR - value: "/tmp/logs" - ports: - - containerPort: 9080 - volumeMounts: - - name: tmp - mountPath: /tmp - - name: wlp-output - mountPath: /opt/ibm/wlp/output - securityContext: - runAsUser: 1000 - volumes: - - name: wlp-output - emptyDir: {} - - name: tmp - emptyDir: {} ---- -################################################################################################## -# Productpage services -################################################################################################## -apiVersion: v1 -kind: Service -metadata: - name: productpage - labels: - app: productpage - service: productpage -spec: - ports: - - port: 9080 - name: http - selector: - app: productpage ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: bookinfo-productpage - labels: - account: productpage ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: productpage-v1 - labels: - app: productpage - version: v1 -spec: - replicas: 1 - selector: - matchLabels: - app: productpage - version: v1 - template: - metadata: - labels: - app: productpage - version: v1 - spec: - serviceAccountName: bookinfo-productpage - containers: - - name: productpage - image: docker.io/istio/examples-bookinfo-productpage-v1:1.17.0 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 9080 - volumeMounts: - - name: tmp - mountPath: /tmp - securityContext: - runAsUser: 1000 - volumes: - - name: tmp - emptyDir: {} ----