Hey do I need to bring down the default nginx ing...
# 🤖|ask-kapa
m
Please stand by @swift-spring-8620 as I search the knowledge base. I normally take about 20 seconds or so. :wave:
---------------------- Based on the information provided in the extracts, it's not explicitly stated whether you need to bring down the default NGINX ingress controller when using an external ingress controller. However, Garden allows you to set up your own ingress controller. This can be done by setting the
setupIngressController
flag to
nginx
or to your own choice of ingress controller such as Traefik, Ambassador, or Istio. Here is an example of how to set the
setupIngressController
flag:
Copy code
yaml
providers:
  - setupIngressController: nginx
If you want to skip installing or enabling the
nginx
ingress controller, you can set
setupIngressController
to
null
or
false
.
Copy code
yaml
providers:
  - setupIngressController: null
Remember to update your configuration based on your specific needs. For more detailed information, you may want to refer to the official Garden documentation here () and here (). ----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon: ----------------------
Let me check the knowledge base for you. One moment! :books:
s
@microscopic-river-74022 I am getting this error: An ingressClass “ngrok-ingress-controller" was set in the provider config for the Kubernetes provider but no matching IngressClass resource was found in the cluster. IngressClass resources are typically created by your Ingress Controller so this may suggest that it has not been properly set up.
m
---------------------- Based on the error message, it seems like the
ngrok-ingress-controller
that you've specified in your provider configuration is not found in your Kubernetes cluster. This could be due to the Ingress Controller not being properly set up. In the Garden Kubernetes provider configuration, you can specify the
ingressClass
or
ingressClassName
to use on configured Ingresses when deploying
container
services. This is particularly useful if you have multiple ingress controllers in your cluster. Here's an example:
Copy code
yaml
providers:
  - ingressClass: ngrok-ingress-controller
However, the
ingressClass
you specify must match an existing IngressClass resource in your Kubernetes cluster. If the IngressClass resource does not exist, you will encounter the error you're seeing. To resolve this issue, you need to ensure that the
ngrok-ingress-controller
IngressClass resource exists in your Kubernetes cluster. You can check the existing IngressClass resources in your cluster by running the following command:
Copy code
bash
kubectl get ingressclass
If the
ngrok-ingress-controller
is not listed, you will need to properly set it up. The setup process can vary depending on the specific ingress controller you're using. You may need to refer to the specific documentation or setup guide for the
ngrok-ingress-controller
. For more information on how to configure the
ingressClass
in Garden, you can refer to the official Garden documentation here (). ----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon: ----------------------
s
@microscopic-river-74022 I am getting the following error: Error validating spec for Deploy type=container name=php-fpm (php-example/services/php-fpm): key .ingresses[0][port] is required. Available keys: command, args, env, cpu, memory, volumes, privileged, addCapabilities, dropCapabilities, tty, deploymentStrategy, annotations, daemon, sync, localMode, image, ingresses, healthCheck, hotReload, timeout, limits, ports, replicas) For this deploy: --- kind: Deploy type: configmap name: php-fpm-fastcgi-configmap spec: data: fastcgi_params: | SCRIPT_FILENAME $document_root$fastcgi_script_name; PATH_INFO $fastcgi_path_info; --- kind: Build type: container name: php-fpm --- kind: Deploy description: The php container name: php-fpm type: container build: php-fpm dependencies: - deploy.redis spec: ports: - name: http protocol: TCP containerPort: 9000 sync: paths: - target: /var/www/html source: ../../src mode: two-way ingresses: - annotations: nginx.ingress.kubernetes.io/rewrite-target: /index.php?$2 nginx.ingress.kubernetes.io/add-base-url: "true" nginx.ingress.kubernetes.io/backend-protocol: "FASTCGI" nginx.ingress.kubernetes.io/fastcgi-index: "index.php" nginx.ingress.kubernetes.io/fastcgi-params-configmap: "php-fpm-fastcgi-configmap" # Add other annotations as required path: /(.\.php)(/.)? hostname: ${var.baseHostname} port: http
m
Let me check the knowledge base for you. One moment! :books:
---------------------- Based on the error message and the provided deployment configuration, it seems like the
port
key under
ingresses
is not correctly indented. In YAML, indentation is crucial as it determines the relationships between different keys. In your case, the
port
key should be at the same level as
path
and
hostname
under
ingresses
. Here's how it should look:
Copy code
yaml
kind: Deploy
description: The php container
name: php-fpm
type: container
build: php-fpm
dependencies:
  - deploy.redis
spec:
  ports:
    - name: http
      protocol: TCP
      containerPort: 9000
  sync:
    paths:
      - target: /var/www/html
        source: ../../src
        mode: two-way
  ingresses:
    - annotations:
        nginx.ingress.kubernetes.io/rewrite-target: /index.php?$2
        nginx.ingress.kubernetes.io/add-base-url: "true"
        nginx.ingress.kubernetes.io/backend-protocol: "FASTCGI"
        nginx.ingress.kubernetes.io/fastcgi-index: "index.php"
        nginx.ingress.kubernetes.io/fastcgi-params-configmap: "php-fpm-fastcgi-configmap"
      # Add other annotations as required
      path: /(.*\.php)(/.*)?
      hostname: ${var.baseHostname}
      port: http
Please note that the
port
key under
ingresses
should match one of the
name
values under
ports
. In your case, it's
http
. For more information on how to configure
ingresses
in Garden, you can refer to the official Garden documentation here (). ----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon: ----------------------
s
@microscopic-river-74022 I am still getting a 503 service temporarily unavailable error even with my current configuration: --- kind: Deploy type: configmap name: php-fpm-fastcgi-configmap spec: data: fastcgi_params: | SCRIPT_FILENAME $document_root$fastcgi_script_name; PATH_INFO $fastcgi_path_info; --- kind: Build type: container name: php-fpm --- kind: Deploy description: The php container name: php-fpm type: container build: php-fpm dependencies: - deploy.redis spec: ports: - name: http protocol: TCP containerPort: 9000 sync: paths: - target: /var/www/html source: ../../src mode: two-way ingresses: - annotations: nginx.ingress.kubernetes.io/rewrite-target: /index.php?$2 nginx.ingress.kubernetes.io/add-base-url: "true" nginx.ingress.kubernetes.io/backend-protocol: "FASTCGI" nginx.ingress.kubernetes.io/fastcgi-index: "index.php" nginx.ingress.kubernetes.io/fastcgi-params-configmap: "php-fpm-fastcgi-configmap" # Add other annotations as required path: / hostname: ${var.baseHostname} port: http Can you suggest how I can adjust this to ensure php-fpm is working correctly?
m
Let me check the knowledge base for you. One moment! :books:
---------------------- Based on the provided information, it's not clear why you're receiving a 503 Service Temporarily Unavailable error. This error typically means that the server is unable to handle the request, possibly due to being overloaded or undergoing maintenance. However, there are a few things you can check or adjust in your configuration: 1. **Check the status of your services**: Use the
garden get status
command to check the status of your services. Make sure that all your services, including
php-fpm
and
redis
, are running as expected. 2. **Check the logs**: Use the
garden logs
command to check the logs of your services. This might give you more information about what's causing the 503 error. 3. **Health checks**: You might want to add a health check for your
php-fpm
service. This can help Garden know when your service is ready to receive requests. Here's an example of how to add a health check:
Copy code
yaml
    kind: Deploy
    description: The php container
    name: php-fpm
    type: container
    build: php-fpm
    dependencies:
      - deploy.redis
    spec:
      ports:
        - name: http
          protocol: TCP
          containerPort: 9000
      sync:
        paths:
          - target: /var/www/html
            source: ../../src
            mode: two-way
      healthCheck:
        httpGet:
          path: /health
          port: http
        initialDelaySeconds: 10
        timeoutSeconds: 5
      ingresses:
        - annotations:
            nginx.ingress.kubernetes.io/rewrite-target: /index.php?$2
            nginx.ingress.kubernetes.io/add-base-url: "true"
            nginx.ingress.kubernetes.io/backend-protocol: "FASTCGI"
            nginx.ingress.kubernetes.io/fastcgi-index: "index.php"
            nginx.ingress.kubernetes.io/fastcgi-params-configmap: "php-fpm-fastcgi-configmap"
          # Add other annotations as required
          path: /
          hostname: ${var.baseHostname}
          port: http
In this example, Garden will send an HTTP GET request to the
/health
endpoint on the
http
port of your service. If the service responds with a status code between 200 and 399, it's considered healthy. You'll need to adjust the
path
and
port
to match your actual health check endpoint. 4. **Check your PHP-FPM configuration**: Make sure that your PHP-FPM is correctly configured to handle requests. This includes checking the
listen
directive in your PHP-FPM pool configuration and ensuring that PHP-FPM is correctly configured to work with NGINX.
Remember to replace any placeholder values in the examples with your actual values. For more information, you can refer to the official Garden documentation here (). ----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon: ----------------------
5 Views