Browse Source

Changed Dev guide

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Gustavo Carvalho 4 years ago
parent
commit
33fb42df53

+ 1 - 0
deploy/charts/external-secrets/README.md

@@ -36,6 +36,7 @@ The command removes all the Kubernetes components associated with the chart and
 |-----|------|---------|-------------|
 |-----|------|---------|-------------|
 | affinity | object | `{}` |  |
 | affinity | object | `{}` |  |
 | concurrent | int | `1` | Specifies the number of concurrent ExternalSecret Reconciles external-secret executes at a time. |
 | concurrent | int | `1` | Specifies the number of concurrent ExternalSecret Reconciles external-secret executes at a time. |
+| controllerClass | string | `""` | If set external secrets will filter matching  Secret Stores with the appropriate controller values. |
 | deploymentAnnotations | object | `{}` | Annotations to add to Deployment |
 | deploymentAnnotations | object | `{}` | Annotations to add to Deployment |
 | extraArgs | object | `{}` |  |
 | extraArgs | object | `{}` |  |
 | extraEnv | list | `[]` |  |
 | extraEnv | list | `[]` |  |

+ 3 - 0
deploy/charts/external-secrets/templates/deployment.yaml

@@ -51,6 +51,9 @@ spec:
           {{- if .Values.scopedNamespace }}
           {{- if .Values.scopedNamespace }}
           - --namespace={{ .Values.scopedNamespace }}
           - --namespace={{ .Values.scopedNamespace }}
           {{- end }}
           {{- end }}
+          {{- if .Values.controllerClass }}
+          - --controller-class={{ .Values.controllerClass }}
+          {{- end }}
           {{- if .Values.concurrent }}
           {{- if .Values.concurrent }}
           - --concurrent={{ .Values.concurrent }}
           - --concurrent={{ .Values.concurrent }}
           {{- end }}
           {{- end }}

+ 4 - 0
deploy/charts/external-secrets/values.yaml

@@ -17,6 +17,10 @@ fullnameOverride: ""
 # than one instance of external-secrets operates at a time.
 # than one instance of external-secrets operates at a time.
 leaderElect: false
 leaderElect: false
 
 
+# -- If set external secrets will filter matching 
+# Secret Stores with the appropriate controller values.
+controllerClass: ""
+
 # -- If set external secrets are only reconciled in the
 # -- If set external secrets are only reconciled in the
 # provided namespace
 # provided namespace
 scopedNamespace: ""
 scopedNamespace: ""

+ 7 - 0
docs/contributing-devguide.md

@@ -74,8 +74,15 @@ kind create cluster --name external-secrets
 export TAG=v2
 export TAG=v2
 export IMAGE=eso-local
 export IMAGE=eso-local
 
 
+#For building in linux
 docker build . -t $IMAGE:$TAG --build-arg TARGETARCH=amd64 --build-arg TARGETOS=linux
 docker build . -t $IMAGE:$TAG --build-arg TARGETARCH=amd64 --build-arg TARGETOS=linux
 
 
+#For building in MacOS (OSX)
+#docker build . -t $IMAGE:$TAG --build-arg TARGETARCH=amd64 --build-arg TARGETOS=darwin
+
+#For building in ARM
+#docker build . -t $IMAGE:$TAG --build-arg TARGETARCH=arm --build-arg TARGETOS=linux
+
 make helm.generate
 make helm.generate
 helm upgrade --install external-secrets ./deploy/charts/external-secrets/ --set image.repository=$IMAGE --set image.tag=$TAG
 helm upgrade --install external-secrets ./deploy/charts/external-secrets/ --set image.repository=$IMAGE --set image.tag=$TAG
 ```
 ```

+ 17 - 0
docs/guides-controller-class.md

@@ -0,0 +1,17 @@
+# Controller Classes
+
+> NOTE: this feature is experimental and not highly tested
+
+Controller classes are a proprierty set during the deployment that allows multiple controllers to work in a group of workloard. It works by separating which secretStores are going to be attributed to which controller. For the behavior of a single controller, no extra configuration is needed.
+
+## Setting up Controller Class
+
+In order to deploy the controller with a specific class, install the helm charts specifying the controller class, and create a `SecretStore` with the appropriate `spec.controller` values:
+```
+helm install custom-external-secrets external-secrets/external-secrets --set controllerClass=custom
+```
+``` yaml
+{% include 'controller-class-store.yaml' %}
+```
+
+Now, any `ExternalSecret` bound to this secret store will be evaluated by the operator with the controllerClass custom.

+ 17 - 0
docs/snippets/controller-class-store.yaml

@@ -0,0 +1,17 @@
+apiVersion: external-secrets.io/v1alpha1
+kind: SecretStore
+metadata:
+  name: controller-custom-example
+spec:
+  #define the controller label to the matching value of the deployment
+  controller: custom
+  #configure provider the same way
+  provider:
+    vault:
+      server: "http://vault.default:8200"
+      path: "secret"
+      version: "v2"
+      auth:
+        kubernetes:
+          mountPath: "kubernetes"
+          role: "demo-role"

+ 1 - 0
hack/api-docs/mkdocs.yml

@@ -31,6 +31,7 @@ nav:
     - Introduction: guides-introduction.md
     - Introduction: guides-introduction.md
     - Getting started: guides-getting-started.md
     - Getting started: guides-getting-started.md
     - Advanced Templating: guides-templating.md
     - Advanced Templating: guides-templating.md
+    - Controller Classes: guides-controller-class.md
     - All keys, One secret: guides-all-keys-one-secret.md
     - All keys, One secret: guides-all-keys-one-secret.md
     - Common K8S Secret Types: guides-common-k8s-secret-types.md
     - Common K8S Secret Types: guides-common-k8s-secret-types.md
     - Multi Tenancy: guides-multi-tenancy.md
     - Multi Tenancy: guides-multi-tenancy.md