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
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ To install Operator there are multiple ways

You can clone and repository and install the Operator. You can find the instruction in [here](../DEVELOPMENT.md)

After installing the Operator, to install the required Tekton Component such as Tekton Pipeline, Tekton Triggers, Tekton Chains.
After installing the Operator, to install the required Tekton Component such as Tekton Pipeline, Tekton Triggers.

Create an instance of `TektonConfig` which will create the required components. You can find more details and the available configuration in [TektonConfig](TektonConfig.md).

NOTE: `TektonResult` is an optional component added recently and is not installed through `TektonConfig` currently. You can find the installation steps in its [doc](TektonResult.md).
NOTE: `TektonResult` and `TektonChain` are optional components and are not installed through `TektonConfig` currently. You can find the installation steps in their docs.


## Understanding Tekton Operator
Expand Down
47 changes: 35 additions & 12 deletions docs/TektonChain.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,40 @@ weight: 9

TektonChain custom resource allows user to install and manage [Tekton Chains][chains].

It is recommended to install the components through [TektonConfig](./TektonConfig.md).

The TektonChain CR is as below:
```yaml
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonChain
metadata:
name: chain
spec:
targetNamespace: tekton-pipelines
```
You can install this component using [TektonConfig](./TektonConfig.md) by choosing appropriate `profile`.
TektonChain is an optional component and currently cannot be installed through TektonConfig. It has to be installed separately.

To install TektonChain on your cluster follow steps as given below:

- Make sure Tekton Pipelines is installed on your cluster, using the Operator.

- Create the TektonChain CR.

- On Kubernetes, TektonChain CR is as below:

```yaml
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonChain
metadata:
name: chain
spec:
targetNamespace: tekton-pipelines
```

- On OpenShift, TektonChain CR is as below:

```yaml
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonChain
metadata:
name: chain
spec:
targetNamespace: openshift-pipelines
```

- Check the status of installation using following command:

```sh
kubectl get tektonchains.operator.tekton.dev
```

[chains]:https://github.com/tektoncd/chains
7 changes: 3 additions & 4 deletions docs/TektonConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Operator provides support for installing and managing following operator compone

- [TektonPipeline](./TektonPipeline.md)
- [TektonTrigger](./TektonTrigger.md)
- [TektonChain](./TektonChain.md)

Other than the above components depending on the platform operator also provides support for

- On both Kubernetes and OpenShift
- [TektonChain](./TektonChain.md)
- On Kubernetes
- [TektonDashboard](./TekonDashboard.md)
- On OpenShift
Expand Down Expand Up @@ -74,13 +74,12 @@ By default, namespace would be `tekton-pipelines` for Kubernetes and `openshift-

This allows user to choose which all components to install on the cluster.
There are 3 profiles available:
- `all`: This profile will install all components (TektonPipeline, TektonTrigger and TektonChain)
- `all`: This profile will install all components (TektonPipeline and TektonTrigger)
- `basic`: This profile will install only TektonPipeline and TektonTrigger component
- `lite`: This profile will install only TektonPipeline component

On Kubernetes, `all` profile will install `TektonDashboard` and on OpenShift `TektonAddon` will be installed.


### Config

Config provides fields to configure deployments created by the Operator.
Expand Down
1 change: 0 additions & 1 deletion pkg/reconciler/kubernetes/tektonchain/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
tektonChainreconciler "github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonchain"
"github.com/tektoncd/operator/pkg/reconciler/common"
"k8s.io/client-go/tools/cache"
//kubeclient "knative.dev/pkg/client/injection/kube/client"
"knative.dev/pkg/configmap"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
Expand Down
180 changes: 0 additions & 180 deletions pkg/reconciler/shared/tektonconfig/chain/chain.go

This file was deleted.

46 changes: 0 additions & 46 deletions pkg/reconciler/shared/tektonconfig/chain/chain_test.go

This file was deleted.

6 changes: 0 additions & 6 deletions pkg/reconciler/shared/tektonconfig/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
mf "github.com/manifestival/manifestival"
"github.com/tektoncd/operator/pkg/apis/operator/v1alpha1"
operatorclient "github.com/tektoncd/operator/pkg/client/injection/client"
tektonChaininformer "github.com/tektoncd/operator/pkg/client/injection/informers/operator/v1alpha1/tektonchain"
tektonConfiginformer "github.com/tektoncd/operator/pkg/client/injection/informers/operator/v1alpha1/tektonconfig"
tektonInstallerinformer "github.com/tektoncd/operator/pkg/client/injection/informers/operator/v1alpha1/tektoninstallerset"
tektonPipelineinformer "github.com/tektoncd/operator/pkg/client/injection/informers/operator/v1alpha1/tektonpipeline"
Expand Down Expand Up @@ -92,11 +91,6 @@ func NewExtensibleController(generator common.ExtensionGenerator) injection.Cont
Handler: controller.HandleAll(impl.EnqueueControllerOf),
})

tektonChaininformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
FilterFunc: controller.FilterController(&v1alpha1.TektonConfig{}),
Handler: controller.HandleAll(impl.EnqueueControllerOf),
})

tektonInstallerinformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
FilterFunc: controller.FilterController(&v1alpha1.TektonConfig{}),
Handler: controller.HandleAll(impl.EnqueueControllerOf),
Expand Down
16 changes: 0 additions & 16 deletions pkg/reconciler/shared/tektonconfig/tektonconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
clientset "github.com/tektoncd/operator/pkg/client/clientset/versioned"
tektonConfigreconciler "github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonconfig"
"github.com/tektoncd/operator/pkg/reconciler/common"
"github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/chain"
"github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/pipeline"
"github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/trigger"
"k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -145,21 +144,6 @@ func (r *Reconciler) ReconcileKind(ctx context.Context, tc *v1alpha1.TektonConfi
}
}

// Create TektonChain CR if profile is all
if tc.Spec.Profile == v1alpha1.ProfileAll {
if _, err := chain.EnsureTektonChainExists(ctx, r.operatorClientSet.OperatorV1alpha1().TektonChains(), tc); err != nil {
tc.Status.MarkComponentNotReady(fmt.Sprintf("TektonChain: %s", err.Error()))
r.enqueueAfter(tc, 10*time.Second)
return err
}
} else {
if err := chain.TektonChainCRDelete(ctx, r.operatorClientSet.OperatorV1alpha1().TektonChains(), v1alpha1.ChainResourceName); err != nil {
tc.Status.MarkComponentNotReady(fmt.Sprintf("TektonChain: %s", err.Error()))
r.enqueueAfter(tc, 10*time.Second)
return err
}
}

if err := common.Prune(ctx, r.kubeClientSet, tc); err != nil {
tc.Status.MarkComponentNotReady(fmt.Sprintf("tekton-resource-pruner: %s", err.Error()))
logger.Error(err)
Expand Down
Loading