Managing Ingress Gateway Deployment Bindings with kubectl
With the kubectl
command you can create, update, move, list, view,
and delete an ingress gateway deployment. The following topics detail how to manage these
operations with kubectl
.
View Kubernetes Configuration Options for Ingress Gateway Deployments
You can view the Kubernetes CLI ingress gateway deployment YAML configuration options by displaying the Custom Resource Definition (CRD). Use the following command:
kubectl describe crd ingressgatewaydeployments.servicemesh.oci.oracle.com
In the CRD, you see the fields used in a YAML configuration file under
spec:schema:openAPIV3Schema:properties:spec
. CRD output also
includes information about field types, ranges, and limits. The following section
provides an example of a YAML configuration file.
Create, Update, or Move an Ingress Gateway Deployment
To create an ingress gateway deployment, use the kubectl apply
command.
Create the ingress gateway deployment using one of the following commands.
-
Create your ingress gateway deployment using the ingress gateway name.
kubectl apply -f - <<EOF apiVersion: servicemesh.oci.oracle.com/v1beta1 kind: IngressGatewayDeployment metadata: name: <sample-ingress-gateway>-deployment namespace: <sample-namespace> spec: ingressGateway: ref: name: <sample-ingress-gateway> deployment: autoscaling: minPods: 1 maxPods: 1 ports: - protocol: TCP port: 8080 serviceport: 80 service: type: LoadBalancer secrets: - secretName: secret-tls-secret EOF
-
Create your ingress gateway deployment using the ingress gateway OCID.
kubectl apply -f - <<EOF apiVersion: servicemesh.oci.oracle.com/v1beta1 kind: IngressGatewayDeployment metadata: name: <sample-ingress-gateway>-deployment namespace: <sample-namespace> spec: ingressGateway: id: <ocid_of_referenced_ig_created_from_cli> deployment: autoscaling: minPods: 1 maxPods: 1 ports: - protocol: TCP port: 8080 serviceport: 80 service: type: LoadBalancer secrets: - secretName: secret-tls-secret EOF
kubectl
: - Change the configuration text as needed.
- Run the
apply
command again.
To move an ingress gateway deployment to a different compartment. Move the linked ingress gateway to a different compartment.
Configure Load Balancer Features for an Ingress Gateway Deployment
You can configure horizontal autoscaling features for your ingress gateway deployment
by adding the following keys under the deployment:
key.
spec:
deployment:
autoscaling:
minPods: 1
maxPods: 4
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
The following descriptions highlight the important keys in the example.
deployment:autoscaling:maxPods
Set the value above one to enable the ability to scale up. In the preceding example, the ingress gateway can scale up to four pods.deployment:requests:memory:
The minimum memory size of the container. In the preceding example, the container starts at 64 Megabytes.deployment:requests:cpu:
The minimum CPU utilization threshold for a container. In the preceding example, the value represents 25% utilization of a virtual CPU. If more than one pod is deployed, a container below this threshold would scale down.deployment:limits:memory:
The maximum memory size of the container. In the preceding example, the container can grow to 128 Megabytes.deployment:limits:cpu:
The maximum CPU utilization threshold for a container. In the preceding example, the value represents 50% utilization of a virtual CPU. If a container reaches this threshold, it scales up.
Adding Service Annotations for Ingress Gateway Deployments
Specify service annotations for load balancers using the
service.annotations
field. The following YAML file snippet is
an example.
spec:
service:
type: LoadBalancer
annotations:
oci.oraclecloud.com/load-balancer-type: "lb"
service.beta.kubernetes.io/oci-load-balancer-shape: "400Mbps"
service.beta.kubernetes.io/oci-load-balancer-subnet1: "ocid..."
service.beta.kubernetes.io/oci-load-balancer-subnet2: "ocid..."
oci.oraclecloud.com/loadbalancer-policy: "IP_HASH"
For a complete list of supported annotations refer to the documentation on GitHub:
Get a List of Ingress Gateway Deployment
To get a list of ingress gateway deployment in your namespace, use the following command:
kubectl get ingressgatewaydeployments -n <namespace>
View an Ingress Gateway Deployment
To view the details of a specific ingress gateway deployment in your namespace, use the following command:
kubectl describe ingressgatewaydeployment <name> -n <namespace>
Delete an Ingress Gateway Deployment
To delete of a specific ingress gateway deployment in your namespace, use the following command:
kubectl delete ingressgatewaydeployment <name> -n <namespace>