Skip to content

Commit

Permalink
Merge pull request #146 from fluxcd/remote-cluster-docs
Browse files Browse the repository at this point in the history
Update remote cluster docs
  • Loading branch information
stefanprodan authored Oct 16, 2020
2 parents fd47af2 + 028c368 commit c0c9600
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 23 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: "^1.14.x"
- run: go version
# Runs a set of commands to initialize and analyze with FOSSA
- name: run FOSSA analysis
env:
- name: Add GOPATH to GITHUB_ENV
run: echo "GOPATH=$(go env GOPATH)" >>"$GITHUB_ENV"
- name: Add GOPATH to GITHUB_PATH
run: echo "$GOPATH/bin" >>"$GITHUB_PATH"
- name: Run FOSSA scan and upload build data
uses: fossa-contrib/fossa-action@v1
with:
# FOSSA Push-Only API Token
FOSSA_API_KEY: '5ee8bf422db1471e0bcf2bcb289185de'
run: |
export GOPATH=$HOME/go
export PATH=$PATH:$(go env GOPATH)/bin
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash
fossa init
fossa analyze
fossa-api-key: 5ee8bf422db1471e0bcf2bcb289185de
github-token: ${{ github.token }}
21 changes: 21 additions & 0 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: rebase

on:
pull_request:
types: [opened]
issue_comment:
types: [created]

jobs:
rebase:
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && (github.event.comment.author_association == 'CONTRIBUTOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Automatic Rebase
uses: cirrus-actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion api/v1beta1/kustomization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ type KustomizationSpec struct {
Interval metav1.Duration `json:"interval"`

// The KubeConfig for reconciling the Kustomization on a remote cluster.
// Apply, Prune, HealthCheck, and Delete are all functional.
// +optional
KubeConfig *KubeConfig `json:"kubeConfig,omitempty"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ spec:
type: string
kubeConfig:
description: The KubeConfig for reconciling the Kustomization on a
remote cluster. Apply, Prune, HealthCheck, and Delete are all functional.
remote cluster.
properties:
secretRef:
description: 'The secret name containing a ''value'' key with
Expand Down
6 changes: 2 additions & 4 deletions docs/api/kustomize.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ KubeConfig
</td>
<td>
<em>(Optional)</em>
<p>The KubeConfig for reconciling the Kustomization on a remote cluster.
Apply, Prune, HealthCheck, and Delete are all functional.</p>
<p>The KubeConfig for reconciling the Kustomization on a remote cluster.</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -562,8 +561,7 @@ KubeConfig
</td>
<td>
<em>(Optional)</em>
<p>The KubeConfig for reconciling the Kustomization on a remote cluster.
Apply, Prune, HealthCheck, and Delete are all functional.</p>
<p>The KubeConfig for reconciling the Kustomization on a remote cluster.</p>
</td>
</tr>
<tr>
Expand Down
21 changes: 15 additions & 6 deletions docs/spec/v1beta1/kustomization.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,15 +543,15 @@ spec:
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
kind: Kustomization
metadata:
name: backend
name: cluster-addons
namespace: capi-stage
spec:
interval: 5m
path: "./webapp/backend/"
path: "./config/addons/"
prune: true
sourceRef:
kind: GitRepository
name: webapp
name: cluster-addons
kubeConfig:
secretRef:
name: stage-kubeconfig # Cluster API creates this for the matching Cluster
Expand All @@ -560,10 +560,19 @@ spec:
The Cluster and Kustomization can be created at the same time.
The Kustomization will eventually reconcile once the cluster is available.

> **Note** that the KubeConfig should be self-contained and not rely on binaries, environment, or credential files
> from the kustomize-controller Pod.
If you wish to target clusters created by other means than CAPI, you can create a ServiceAccount on the remote cluster,
generate a kube config for that account, then create a secret on the cluster where kustomize-controller is running e.g.:

```sh
kubectl create secret generic prod-kubeconfig \
--from-file=value=./kubeconfig
```

> **Note** that the KubeConfig should be self-contained and not rely on binaries, environment,
> or credential files from the kustomize-controller Pod.
> This matches the constraints of KubeConfigs from current Cluster API providers.
> KubeConfigs with `cmd-path` in them likely won't work without a custom, per-cluster installation of kustomize-controller.
> KubeConfigs with `cmd-path` in them likely won't work without a custom,
> per-provider installation of kustomize-controller.

## Secrets decryption

Expand Down

0 comments on commit c0c9600

Please sign in to comment.