Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 11 additions & 11 deletions cli/pkg/kubectl/dev/plugin/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ type DevOptions struct {
Logs *logs.Options
Streams genericclioptions.IOStreams

Image string
Tag string
BackendImage string
BackendTag string
ProviderClusterName string
ConsumerClusterName string
WaitForReadyTimeout time.Duration
Expand Down Expand Up @@ -102,16 +102,16 @@ func (o *DevOptions) AddCmdFlags(cmd *cobra.Command) {
cmd.Flags().DurationVar(&o.WaitForReadyTimeout, "wait-for-ready-timeout", 2*time.Minute, "Timeout for waiting for the cluster to be ready")
cmd.Flags().StringVar(&o.ChartPath, "chart-path", o.ChartPath, "Helm chart path or OCI registry URL")
cmd.Flags().StringVar(&o.ChartVersion, "chart-version", o.ChartVersion, "The version of the Helm chart to use")
cmd.Flags().StringVar(&o.Image, "image", "ghcr.io/kube-bind/backend", "The name of kube-bind backend to use in dev mode")
cmd.Flags().StringVar(&o.Tag, "tag", "", "The tag of the kube-bind backend image to use in dev mode")
cmd.Flags().StringVar(&o.BackendImage, "backend-image", "ghcr.io/kube-bind/backend", "The name of kube-bind backend to use in dev mode")
cmd.Flags().StringVar(&o.BackendTag, "backend-tag", "", "The tag of the kube-bind backend image to use in dev mode")
cmd.Flags().StringVar(&o.KindNetwork, "kind-network", "kube-bind-dev", "The name of the kind network to use in dev mode")
}

// Complete completes the options
func (o *DevOptions) Complete(args []string) error {
// Only fetch the latest version if tag is not set
var assetVersion string
if o.Tag == "" {
if o.BackendTag == "" {
version, err := fetchLatestRelease()
if err != nil {
// Log the error but continue with fallback version
Expand All @@ -125,8 +125,8 @@ func (o *DevOptions) Complete(args []string) error {
if o.ChartVersion == "" || o.ChartVersion == fallbackAssetVersion {
o.ChartVersion = assetVersion
}
if o.Tag == "" || o.Tag == "v"+fallbackAssetVersion {
o.Tag = "v" + assetVersion
if o.BackendTag == "" || o.BackendTag == "v"+fallbackAssetVersion {
o.BackendTag = "v" + assetVersion
}
}

Expand Down Expand Up @@ -391,14 +391,14 @@ func (o *DevOptions) installHelmChart(_ context.Context, restConfig *rest.Config
actionConfig.RegistryClient = registryClient

values := map[string]any{
"image": map[string]any{
"repository": o.Image,
"tag": o.Tag,
},
"examples": map[string]any{
"enabled": true,
},
"backend": map[string]any{
"image": map[string]any{
"repository": o.BackendImage,
"tag": o.BackendTag,
},
"listenAddress": "0.0.0.0:8080",
"namespacePrefix": "kube-bind-",
"externalAddress": "https://kube-bind.dev.local:6443",
Expand Down
6 changes: 3 additions & 3 deletions deploy/charts/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ See [values.yaml](values.yaml) for the full list of configurable parameters.
| backend.externalServerName | string | `""` | External server name for TLS SNI |
| backend.extraArgs | list | `[]` | Extra command-line arguments to pass to the backend |
| backend.frontendDisabled | bool | `false` | Disable the frontend UI |
| backend.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
| backend.image.repository | string | `"ghcr.io/kube-bind/backend"` | Image repository |
| backend.image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion |
| backend.kubeconfig | string | `""` | Path to a kubeconfig file. Only required if out-of-cluster. |
| backend.listenAddress | string | `"0.0.0.0:8080"` | Address the backend listens on |
| backend.loggingLevel | int | `2` | Logging verbosity level |
Expand Down Expand Up @@ -71,9 +74,6 @@ See [values.yaml](values.yaml) for the full list of configurable parameters.
| gatewayApi.route.path | string | `"/"` | Path match for the HTTPRoute |
| gatewayApi.route.pathType | string | `"PathPrefix"` | Path match type for the HTTPRoute |
| hostAliases | list | `[]` | Host aliases for /etc/hosts injection into pods |
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
| image.repository | string | `"ghcr.io/kube-bind/backend"` | Image repository |
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion |
| imagePullSecrets | list | `[]` | Secrets for pulling images from a private repository |
| initContainers | list | `[]` | Additional init containers |
| livenessProbe | object | `{"httpGet":{"path":"/healthz","port":"http"}}` | Liveness probe configuration |
Expand Down
4 changes: 2 additions & 2 deletions deploy/charts/backend/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ spec:
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
env:
{{- if .Values.backend.oidc.clientSecretName }}
- name: OIDC_CLIENT_SECRET
Expand Down
17 changes: 8 additions & 9 deletions deploy/charts/backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ replicaCount: 1

# Backend configuration
backend:
# Container image configuration
image:
# -- Image repository
repository: ghcr.io/kube-bind/backend
# -- Image pull policy
pullPolicy: IfNotPresent
# -- Overrides the image tag whose default is the chart appVersion
tag: ""
# -- Address the backend listens on
listenAddress: "0.0.0.0:8080"
# -- Path to a kubeconfig file. Only required if out-of-cluster.
Expand Down Expand Up @@ -130,15 +138,6 @@ examples:
# -- Enable example resources to seed on first start
enabled: false

# Container image configuration
image:
# -- Image repository
repository: ghcr.io/kube-bind/backend
# -- Image pull policy
pullPolicy: IfNotPresent
# -- Overrides the image tag whose default is the chart appVersion
tag: ""

# -- Secrets for pulling images from a private repository
imagePullSecrets: []
# -- Override the chart name
Expand Down
Loading