Skip to content

Commit 1348997

Browse files
authored
[Doc] Document about using custom ingress controller (#6354)
* [Doc] Document about using custom ingress controller Signed-off-by: Aylei <[email protected]> * Fix link Signed-off-by: Aylei <[email protected]> --------- Signed-off-by: Aylei <[email protected]>
1 parent 8f73757 commit 1348997

File tree

5 files changed

+53
-12
lines changed

5 files changed

+53
-12
lines changed

charts/skypilot/templates/ingress.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
namespace: {{ .Release.Namespace }}
1212
annotations:
1313
{{- if not $useNewIngressClass }}
14-
kubernetes.io/ingress.class: nginx
14+
kubernetes.io/ingress.class: {{ .Values.ingress.ingressClassName }}
1515
{{- end }}
1616
{{- if index .Values.ingress "oauth2-proxy" "enabled" }}
1717
# OAuth2 Proxy authentication for browser-based access
@@ -44,6 +44,9 @@ metadata:
4444
# Set X-Skypilot-Auth-Mode header to the value from the auth request.
4545
proxy_set_header X-Skypilot-Auth-Mode $x_skypilot_auth_mode;
4646
{{- end }}
47+
{{- if .Values.ingress.annotations }}
48+
{{- toYaml .Values.ingress.annotations | nindent 4 }}
49+
{{- end }}
4750

4851
spec:
4952
{{- if $useNewIngressClass }}

charts/skypilot/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ ingress:
164164
path: '/'
165165
# Ingress class name (for newer Kubernetes versions)
166166
ingressClassName: nginx
167+
# Custom annotations for the ingress
168+
annotations: null
167169

168170
# Whether enable an additional NodePort service for the ingress controller
169171
# Default to null for backward compatibility:

docs/source/reference/api-server/api-server-admin-deploy.rst

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Install the SkyPilot Helm chart with the following command:
6666

6767
For more details on the available configuration options, refer to :ref:`SkyPilot API Server Helm Chart Values <helm-values-spec>`.
6868

69-
The above command will install a SkyPilot API server and ingress-nginx controller in the given namespace, which by default conflicts with other installations. To deploy multiple API servers, refer to :ref:`Reusing ingress-nginx controller for API server <sky-api-server-helm-multiple-deploy>`.
69+
The above command will install a SkyPilot API server and ingress-nginx controller in the given namespace, which by default conflicts with other installations. To deploy multiple API servers, refer to :ref:`Reusing ingress-nginx controller for API server <sky-api-server-helm-multiple-deploy>`. To use a different ingress controller, refer to :ref:`sky-api-server-custom-ingress`
7070

7171
.. tip::
7272

@@ -978,6 +978,26 @@ The same approach also applies when you have a ingress-nginx controller deployed
978978
979979
It is a good practice to specify a unique :ref:`ingress.path <helm-values-ingress-path>` too in this case, to avoid conflicts with other backends hosted on the same ingress controller.
980980
981+
.. _sky-api-server-custom-ingress:
982+
983+
Use custom ingress controller
984+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
985+
986+
By default, the SkyPilot helm chart will deploy a new ingress-nginx controller when installing the API server. However, you can use a custom ingress controller by disabling the creation of nginx ingress controller and setting :ref:`ingress.ingressClassName <helm-values-ingress-ingressclassname>` to the ingress class name of your controller. In addition, most of the ingress controllers support customizing behavior by setting annotations on the ingress resource. You can set :ref:`ingress.annotations <helm-values-ingress-annotations>` in the helm values to pass annotations to the ingress resource. Here is an example of using a custom ingress controller:
987+
988+
.. code-block:: bash
989+
990+
helm upgrade --install $RELEASE_NAME skypilot/skypilot-nightly --devel \
991+
--namespace $NAMESPACE \
992+
--reuse-values \
993+
--set ingress-nginx.enabled=false \
994+
--set ingress.ingressClassName=custom-ingress-class \
995+
--set ingress.annotations.custom-ingress-annotation=custom-ingress-annotation-value
996+
997+
.. note::
998+
999+
:ref:`Basic auth on ingress <helm-values-ingress-authcredentials>` and :ref:`OAuth2 <helm-values-ingress-oauth2-proxy>` are only supported when using ingress-nginx controller. For other ingress controllers, you can refer to :ref:`deploy-api-server-basic-auth` to setup authentication on the API server.
1000+
9811001
9821002
.. _sky-api-server-cloud-deploy:
9831003

docs/source/reference/api-server/api-server-upgrade.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Optionally, you can watch the upgrade progress with:
5757

5858
.. code-block:: console
5959
60-
$ kubectl get pod -l app=${RELEASE_NAME}-api --watch
60+
$ kubectl get pod --namespace $NAMESPACE -l app=${RELEASE_NAME}-api --watch
6161
NAME READY STATUS RESTARTS AGE
6262
skypilot-demo-api-server-cf4896bdf-62c96 0/1 Init:0/2 0 7s
6363
skypilot-demo-api-server-cf4896bdf-62c96 0/1 Init:1/2 0 24s

docs/source/reference/api-server/helm-values-spec.rst

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Below is the available helm value keys and the default value of each key:
9494
:ref:`nodePortEnabled <helm-values-ingress-nodePortEnabled>`: null
9595
:ref:`httpNodePort <helm-values-ingress-httpNodePort>`: 30050
9696
:ref:`httpsNodePort <helm-values-ingress-httpsNodePort>`: 30051
97+
:ref:`annotations <helm-values-ingress-annotations>`: null
9798
:ref:`oauth2-proxy <helm-values-ingress-oauth2-proxy>`:
9899
:ref:`enabled <helm-values-ingress-oauth2-proxy-enabled>`: false
99100
# Required when enabled:
@@ -912,6 +913,21 @@ Default: ``30051``
912913
ingress:
913914
httpsNodePort: 30051
914915
916+
.. _helm-values-ingress-annotations:
917+
918+
``ingress.annotations``
919+
^^^^^^^^^^^^^^^^^^^^^^^
920+
921+
Custom annotations for the ingress controller.
922+
923+
Default: ``null``
924+
925+
.. code-block:: yaml
926+
927+
ingress:
928+
annotations:
929+
my-annotation: "my-value"
930+
915931
.. _helm-values-ingress-oauth2-proxy:
916932
917933
``ingress.oauth2-proxy``
@@ -1239,15 +1255,15 @@ Default: see the yaml below.
12391255
- apiGroups: ["apps"]
12401256
resources: ["deployments", "deployments/status"]
12411257
verbs: ["*"]
1242-
- apiGroups: [ "" ]
1243-
resources: [ "configmaps" ]
1244-
verbs: [ "get", "patch" ]
1245-
- apiGroups: ["apps"]
1246-
resources: ["deployments", "deployments/status"]
1247-
verbs: ["*"]
1248-
- apiGroups: [""]
1249-
resources: ["persistentvolumeclaims"]
1250-
verbs: ["*"]
1258+
- apiGroups: [ "" ]
1259+
resources: [ "configmaps" ]
1260+
verbs: [ "get", "patch" ]
1261+
- apiGroups: ["apps"]
1262+
resources: ["deployments", "deployments/status"]
1263+
verbs: ["*"]
1264+
- apiGroups: [""]
1265+
resources: ["persistentvolumeclaims"]
1266+
verbs: ["*"]
12511267
12521268
.. _helm-values-rbac-clusterRules:
12531269

0 commit comments

Comments
 (0)