Skip to content

Instantly share code, notes, and snippets.

@codingforentrepreneurs
Last active June 10, 2023 18:24
Show Gist options
  • Save codingforentrepreneurs/e21a9b6b0b81e32ec5664fecf6e1cd5e to your computer and use it in GitHub Desktop.
Save codingforentrepreneurs/e21a9b6b0b81e32ec5664fecf6e1cd5e to your computer and use it in GitHub Desktop.
Install Knative & Istio on Kubernetes
# Get version at https://knative.dev/docs/install/yaml-install/serving/install-serving-with-yaml/
export KNATIVE_VERSION="v1.10.1" # ensure ISTIO install matches this version too
# Install knative serving
# Ref: https://knative.dev/docs/install/yaml-install/serving/install-serving-with-yaml/#install-the-knative-serving-component
kubectl apply -f https://github.com/knative/serving/releases/download/knative-$KNATIVE_VERSION/serving-crds.yaml
kubectl apply -f https://github.com/knative/serving/releases/download/knative-$KNATIVE_VERSION/serving-core.yaml
# install istio
# Ref: https://knative.dev/docs/install/yaml-install/serving/install-serving-with-yaml/#install-a-networking-layer
kubectl apply -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-$KNATIVE_VERSION/istio.yaml
kubectl apply -f https://github.com/knative/net-istio/releases/download/knative-$KNATIVE_VERSION/istio.yaml
kubectl apply -f https://github.com/knative/net-istio/releases/download/knative-$KNATIVE_VERSION/net-istio.yaml
# Confirm installed:
kubectl --namespace istio-system get service istio-ingressgateway
export KNATIVE_INGRESS_IP=$(kubectl --namespace istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo "Your IP Address is: $KNATIVE_INGRESS_IP"
echo "Add a cname record for your domain using the above IP address."
# curl http://$KNATIVE_INGRESS_IP -H "Host: cfe-nginx.default.svc.cluster.local"

Terraforming Kubernetes Session 4: Going Serverless

This gist is a reference for a live series called Terraforming Kubernetes. The point of this gist is to give you a quick way to:

  1. Use Terraform via Object Storage and Github Actions
  2. Provision a Kubernetes Cluster
  3. Install Knative and Istio

Guide

Step 1: Fork tf-python

Step 2: Create an Akamai Linode Account

Step 3: Create an Object Storage Bucket for Terraform State Files

Note: Use us-east-1 (Newark, NJ) or update the configuration in infra/main.tf

Step 4. Update your Github Actions Repo Secrets

Step 5. Run Sync Infrastructure via Terraform Github Action

Assuming you forked tf-python correctly, you should have a Github Action called Sync Infrastructure via Terraform. Run this to provision your kubernetes cluster.

Step 6. Login to the Linode Console and get the Kubeconfig file from your newly created cluster.

Step 7. Install Knative & Istio

Run 1-install-knative-istio.sh or run kubctl commands within that file manually (if on windows).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment