To deploy Istio resources on your Kubernetes cluster,

Category : Kubernetes | Sub Category : Kubernetes With Java | By Prasad Bonam Last updated: 2023-11-21 14:22:11 Viewed : 220


To deploy Istio resources on your Kubernetes cluster, you can use the Istio command-line interface (Istioctl) or Helm charts. Below, I will provide examples for deploying basic Istio resources using istioctl.

1. Download and Install Istio:

Download the Istio release from the official Istio releases page. Choose the version that suits your needs.

Extract the downloaded file:

bash
tar -zxvf istio-<version>.tar.gz cd istio-<version

2. Install Istio on the Cluster:

Run the following command to install Istio components on your Kubernetes cluster:

bash
istioctl install

This will deploy the core Istio components, including Istio IngressGateway and the necessary Custom Resource Definitions (CRDs).

3. Deploy Sample Application (Optional):

You can deploy a sample application to test Istio features. Use the following command:

bash
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml

4. Enable Istio Sidecar Injection:

Enable automatic sidecar injection for the namespace where you deploy your application. If you want to enable sidecar injection for the default namespace, run:

bash
kubectl label namespace default istio-injection=enabled

5. Verify Installation:

Check the status of the Istio components and the sample application:

bash
kubectl get pods -n istio-system kubectl get services -n istio-system kubectl get pods kubectl get services

6. Deploy Istio Gateway and VirtualService:

Create a file named istio-gateway.yaml with the following content to define an Istio Gateway and VirtualService for the sample application:

yaml
apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: bookinfo-gateway spec: selector: istio: ingressgateway servers: - port: number: 80 name: http protocol: HTTP hosts: - "*" --- apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: bookinfo spec: hosts: - "*" gateways: - bookinfo-gateway http: - match: - uri: exact: /productpage route: - destination: host: productpage port: number: 9080

Apply the configuration:

bash
kubectl apply -f istio-gateway.yaml

7. Access the Sample Application:

Retrieve the external IP of the Istio Ingress Gateway:

bash
kubectl get svc -n istio-system istio-ingressgateway

Access the sample application using the external IP.

8. Explore Istio Dashboard (Optional):

If you installed Kiali as part of Istio addons, you can access the Kiali dashboard to visualize the service mesh:

bash
kubectl port-forward -n istio-system svc/kiali 20001:20001

Open your browser and navigate to http://localhost:20001.

These are basic steps to deploy Istio resources and a sample application. Depending on your use case, you might need to configure additional Istio features such as traffic management, security policies, or telemetry. Refer to the official Istio documentation for more detailed information and advanced configurations.

Search
Related Articles

Leave a Comment: