Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions charts/skupper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,43 @@ kubeAdaptorImage: examplemirror.acme.com/skupper/kube-adaptor:2.0.0
routerImage: examplemirror.acme.com/skupper/skupper-router:3.3.0
```

### Access Type Configuration

The chart supports configuring how the Skupper router is exposed externally via
the `accessType` field on `RouterAccess` and `Site` resources. The controller
supports the following access types: `local`, `loadbalancer`, `route`,
`nodeport`, `ingress-nginx`, `contour-http-proxy`, and `gateway`.

By default the controller enables `local`, `loadbalancer`, and `route`. Use
the values below to change this behaviour.

| Value | Default | Description |
|---|---|---|
| `clusterHost` | `""` | IP or hostname of any cluster node. **Required** when `nodeport` is enabled. |
| `enabledAccessTypes` | `""` | Comma-separated list of enabled access types. Defaults to `local,loadbalancer,route` when empty. |
| `defaultAccessType` | `""` | Default access type for sites that do not specify one. Auto-selected when empty. |

#### Using NodePort

NodePort exposes the router on a high port of every cluster node. Set
`clusterHost` to the IP or hostname that clients can use to reach a node, and
include `nodeport` in `enabledAccessTypes`:

```bash
helm install skupper oci://quay.io/skupper/helm/skupper \
--set clusterHost=192.168.1.100 \
--set enabledAccessTypes="local,loadbalancer,route,nodeport" \
--set defaultAccessType=nodeport
```

Or with an override `values.yaml` file:

```yaml
clusterHost: "192.168.1.100"
enabledAccessTypes: "local,loadbalancer,route,nodeport"
defaultAccessType: "nodeport"
```

## Alternative Installation Methods

In addition to this Helm Chart, Skupper releases static manifest [YAML](../../cmd/controller/README.md) for
Expand Down
56 changes: 45 additions & 11 deletions scripts/skupper-helm-chart-generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ routerImage: quay.io/skupper/skupper-router:$ROUTER_VERSION
# available options: cluster, namespace
scope: cluster

# Access type configuration
# Set clusterHost to the IP or hostname of any cluster node.
# Required when nodeport is included in enabledAccessTypes.
clusterHost: ""

# Comma-separated list of enabled access types.
# Supported: local, loadbalancer, route, nodeport, ingress-nginx,
# contour-http-proxy, gateway
# Defaults (when empty): local,loadbalancer,route
enabledAccessTypes: ""

# Default access type used when a Site does not specify one.
# When empty the controller auto-selects (route on OpenShift, else loadbalancer).
defaultAccessType: ""

EOF

cat <<EOF >"$TEMPLATES_DIR/NOTES.txt"
Expand Down Expand Up @@ -99,17 +114,36 @@ else
fi

# Substitute "namespace: <name>" with "namespace: {{ .Release.Namespace }}"
sed -i 's/namespace: [a-zA-Z0-9.-]*/namespace: {{ .Release.Namespace }}/g' "$CLUSTER_TEMPLATE"

sed -i -E 's|quay.io/skupper/controller:[a-zA-Z0-9.-]*|{{ .Values.controllerImage }}|' "$CLUSTER_TEMPLATE"
sed -i -E 's|quay.io/skupper/controller:[a-zA-Z0-9.-]*|{{ .Values.controllerImage }}|' "$NAMESPACE_TEMPLATE"

sed -i -E 's|quay.io/skupper/skupper-router:[a-zA-Z0-9.-]*|{{ .Values.routerImage }}|' "$CLUSTER_TEMPLATE"
sed -i -E 's|quay.io/skupper/skupper-router:[a-zA-Z0-9.-]*|{{ .Values.routerImage }}|' "$NAMESPACE_TEMPLATE"


sed -i 's|quay.io/skupper/kube-adaptor:[a-zA-Z0-9.-]*|{{ .Values.kubeAdaptorImage }}|g' "$CLUSTER_TEMPLATE"
sed -i 's|quay.io/skupper/kube-adaptor:[a-zA-Z0-9.-]*|{{ .Values.kubeAdaptorImage }}|g' "$NAMESPACE_TEMPLATE"
sed 's/namespace: [a-zA-Z0-9.-]*/namespace: {{ .Release.Namespace }}/g' "$CLUSTER_TEMPLATE" > "${CLUSTER_TEMPLATE}.tmp" && mv "${CLUSTER_TEMPLATE}.tmp" "$CLUSTER_TEMPLATE"

sed -E 's|quay.io/skupper/controller:[a-zA-Z0-9.-]*|{{ .Values.controllerImage }}|' "$CLUSTER_TEMPLATE" > "${CLUSTER_TEMPLATE}.tmp" && mv "${CLUSTER_TEMPLATE}.tmp" "$CLUSTER_TEMPLATE"
sed -E 's|quay.io/skupper/controller:[a-zA-Z0-9.-]*|{{ .Values.controllerImage }}|' "$NAMESPACE_TEMPLATE" > "${NAMESPACE_TEMPLATE}.tmp" && mv "${NAMESPACE_TEMPLATE}.tmp" "$NAMESPACE_TEMPLATE"

sed -E 's|quay.io/skupper/skupper-router:[a-zA-Z0-9.-]*|{{ .Values.routerImage }}|' "$CLUSTER_TEMPLATE" > "${CLUSTER_TEMPLATE}.tmp" && mv "${CLUSTER_TEMPLATE}.tmp" "$CLUSTER_TEMPLATE"
sed -E 's|quay.io/skupper/skupper-router:[a-zA-Z0-9.-]*|{{ .Values.routerImage }}|' "$NAMESPACE_TEMPLATE" > "${NAMESPACE_TEMPLATE}.tmp" && mv "${NAMESPACE_TEMPLATE}.tmp" "$NAMESPACE_TEMPLATE"

sed 's|quay.io/skupper/kube-adaptor:[a-zA-Z0-9.-]*|{{ .Values.kubeAdaptorImage }}|g' "$CLUSTER_TEMPLATE" > "${CLUSTER_TEMPLATE}.tmp" && mv "${CLUSTER_TEMPLATE}.tmp" "$CLUSTER_TEMPLATE"
sed 's|quay.io/skupper/kube-adaptor:[a-zA-Z0-9.-]*|{{ .Values.kubeAdaptorImage }}|g' "$NAMESPACE_TEMPLATE" > "${NAMESPACE_TEMPLATE}.tmp" && mv "${NAMESPACE_TEMPLATE}.tmp" "$NAMESPACE_TEMPLATE"

# Inject Helm conditional env vars for access type configuration before the
# SKUPPER_KUBE_ADAPTOR_IMAGE env var (used as a stable anchor in both templates).
for TEMPLATE in "$CLUSTER_TEMPLATE" "$NAMESPACE_TEMPLATE"; do
awk '/- name: SKUPPER_KUBE_ADAPTOR_IMAGE$/{
print " {{- if .Values.clusterHost }}"
print " - name: SKUPPER_CLUSTER_HOST"
print " value: {{ .Values.clusterHost | quote }}"
print " {{- end }}"
print " {{- if .Values.enabledAccessTypes }}"
print " - name: SKUPPER_ENABLED_ACCESS_TYPES"
print " value: {{ .Values.enabledAccessTypes | quote }}"
print " {{- end }}"
print " {{- if .Values.defaultAccessType }}"
print " - name: SKUPPER_DEFAULT_ACCESS_TYPE"
print " value: {{ .Values.defaultAccessType | quote }}"
print " {{- end }}"
}
{ print }' "$TEMPLATE" > "${TEMPLATE}.tmp" && mv "${TEMPLATE}.tmp" "$TEMPLATE"
done


echo "Helm chart directory structure created successfully for '$CHART_NAME' with version=$VERSION and appVersion=$APP_VERSION."