#!/bin/bash # shellcheck disable=SC2034,SC2153,SC2155,SC2164 # Copyright Istio Authors. 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. #################################################################################################### # WARNING: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT. PLEASE MODIFY THE ORIGINAL MARKDOWN FILE: # docs/tasks/traffic-management/egress/egress-tls-origination/index.md #################################################################################################### snip_before_you_begin_1() { kubectl apply -f samples/sleep/sleep.yaml } snip_before_you_begin_2() { kubectl apply -f <(istioctl kube-inject -f samples/sleep/sleep.yaml) } snip_before_you_begin_3() { export SOURCE_POD=$(kubectl get pod -l app=sleep -o jsonpath={.items..metadata.name}) } snip_apply_simple() { kubectl apply -f - < Welcome to nginx! ... ENDSNIP snip_configure_mutual_tls_origination_for_egress_traffic_at_sidecar_4() { kubectl logs -l app=sleep -c istio-proxy | grep 'my-nginx.mesh-external.svc.cluster.local' } snip_cleanup_the_mutual_tls_origination_configuration_1() { kubectl delete secret nginx-server-certs nginx-ca-certs -n mesh-external kubectl delete secret client-credential kubectl delete rolebinding client-credential-role-binding kubectl delete role client-credential-role kubectl delete configmap nginx-configmap -n mesh-external kubectl delete service my-nginx -n mesh-external kubectl delete deployment my-nginx -n mesh-external kubectl delete namespace mesh-external kubectl delete serviceentry originate-mtls-for-nginx kubectl delete destinationrule originate-mtls-for-nginx } snip_cleanup_the_mutual_tls_origination_configuration_2() { rm example.com.crt example.com.key my-nginx.mesh-external.svc.cluster.local.crt my-nginx.mesh-external.svc.cluster.local.key my-nginx.mesh-external.svc.cluster.local.csr client.example.com.crt client.example.com.csr client.example.com.key } snip_cleanup_the_mutual_tls_origination_configuration_3() { rm ./nginx.conf } snip_cleanup_common_configuration_1() { kubectl delete service sleep kubectl delete deployment sleep }