From fd7120d46e7106270f1b2de143dc76c21338b9df Mon Sep 17 00:00:00 2001 From: Gor Poghosyan Date: Thu, 4 Mar 2021 19:27:43 +0400 Subject: [PATCH] Update-2021-03-04_15:27:43 --- charts/netris-operator/Chart.yaml | 4 +- charts/netris-operator/README.md | 111 ++++++++++++++++++ .../crds/k8s.netris.ai_vnets.yaml | 52 ++++++++ 3 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 charts/netris-operator/README.md diff --git a/charts/netris-operator/Chart.yaml b/charts/netris-operator/Chart.yaml index 6f3839f..01e0e3e 100644 --- a/charts/netris-operator/Chart.yaml +++ b/charts/netris-operator/Chart.yaml @@ -15,12 +15,12 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.4 +version: 0.2.5 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: v0.3.2 +appVersion: v0.3.3 home: https://github.com/netrisai/netris-operator icon: https://www.netris.ai/wp-content/uploads/2020/05/logo-600.png # [todo] Change url to permalink keywords: diff --git a/charts/netris-operator/README.md b/charts/netris-operator/README.md new file mode 100644 index 0000000..8c9d401 --- /dev/null +++ b/charts/netris-operator/README.md @@ -0,0 +1,111 @@ +# Netris-Operator + +Netris-operator runs within your Kubernetes cluster as a deployment resource. It utilizes CustomResourceDefinitions to configure netris cloud resources. + +## Prerequisites + +- Kubernetes 1.16+ +- Helm 3.1+ + +## Installing the Chart + +In order to install the Helm chart, you must follow these steps: + +Create the namespace for netris-operator: + +``` +kubectl create namespace netris-operator +``` + +Add the Netris Helm repository: + +``` +helm repo add netrisai https://netrisai.github.io/charts +``` + +Update your local Helm chart repository cache: + +``` +helm repo update +``` + +### Option 1: Creds from secret + +1) Create credentials secret for netris-operator: + +``` +kubectl -n netris-operator create secret generic netris-creds \ + --from-literal=host="http://example.com" \ + --from-literal=login="login" --from-literal=password="pass" +``` + +2) Install helm chart + +``` +helm install netris-operator netrisai/netris-operator \ +--namespace netris-operator +``` + +### Option 2: Creds from helm values + + 1) Install helm chart with netris controller creds + +``` +helm install netris-operator netrisai/netris-operator \ +--namespace netris-operator \ +--set controller.host="http://example.com" \ +--set controller.login="login" \ +--set controller.password="pass" +``` + +## Uninstalling the Chart + +To uninstall/delete the `netris-operator` helm release: + +``` +helm uninstall netris-operator +``` + +## Configuration + +The following table lists the configurable parameters of the netris-operator chart and their default values. + +### Common parameters + +| Parameter | Description | Default | +| ------------------------------------- | --------------------------------------------------------------------------------------------------------- | -------------------------- | +| `nameOverride` | String to partially override common.names.fullname template with a string (will prepend the release name) | `nil` | +| `fullnameOverride` | String to fully override common.names.fullname template with a string | `nil` | +| `rbac.create` | Specify if an rbac authorization should be created with the necessarry Rolebindings | `true` | +| `serviceAccount.create` | Create a serviceAccount for the deployment | `true` | +| `serviceAccount.name` | Use the serviceAccount with the specified name | `""` | +| `serviceAccount.annotations` | Annotations to add to the service account | `{}` | +| `podAnnotations` | Pod annotations | `{}` | +| `podSecurityContext` | Pod Security Context | `{}` | +| `securityContext` | Containers security context | `{}` | +| `service.type` | kube-rbac-proxy Service type | `ClusterIP` | +| `service.port` | kube-rbac-proxy Service port | `8443` | +| `resources` | CPU/memory resource requests/limits | `{}` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `tolerations` | Node tolerations for pod assignment | `[]` | +| `affinity` | Node affinity for pod assignment | `{}` | + +### Netris-Operator parameters +| Parameter | Description | Default | +| ------------------------------------- | --------------------------------------------------------------------------------------------------------- | -------------------------- | +| `imagePullSecrets` | Reference to one or more secrets to be used when pulling images | `[]` | +| `image.repository` | Image repository | `netrisai/netris-operator` | +| `image.tag` | Image tag. Overrides the image tag whose default is the chart appVersion | `""` | +| `image.pullPolicy` | Image pull policy | `Always` | +| `controller.host` | Netris controller host url (`http://example.com`) | `""` | +| `controller.login` | Netris controller login | `""` | +| `controller.password` | Netris controller password | `""` | +| `controller.insecure` | Allow insecure server connections when using SSL | `false` | +| `controllerCreds.host.secretName` | Name of existing secret to use for Netris controller host. Ignored if `controller.host` is set | `netris-creds` | +| `controllerCreds.host.key` | Netris controller host key in existing secret. Ignored if `controller.host` is set | `host` | +| `controllerCreds.login.secretName` | Name of existing secret to use for Netris controller login. Ignored if `controller.login` is set | `netris-creds` | +| `controllerCreds.login.key` | Netris controller login key in existing secret. Ignored if `controller.login` is set | `login` | +| `controllerCreds.password.secretName` | Name of existing secret to use for Netris controller password. Ignored if `controller.password` is set | `netris-creds` | +| `controllerCreds.password.key` | Netris controller password key in existing secret. Ignored if `controller.password` is set | `password` | +| `logLevel` | Log level of netris-operator. Allowed values: `info` or `debug` | `info` | +| `requeueInterval` | Requeue interval in seconds for the netris-operator | `15` | diff --git a/charts/netris-operator/crds/k8s.netris.ai_vnets.yaml b/charts/netris-operator/crds/k8s.netris.ai_vnets.yaml index 99c9ed6..402dd10 100644 --- a/charts/netris-operator/crds/k8s.netris.ai_vnets.yaml +++ b/charts/netris-operator/crds/k8s.netris.ai_vnets.yaml @@ -8,6 +8,33 @@ metadata: creationTimestamp: null name: vnets.k8s.netris.ai spec: + additionalPrinterColumns: + - JSONPath: .status.state + name: State + type: string + - JSONPath: .status.gateways + name: Gateways + type: string + - JSONPath: .status.sites + name: Sites + type: string + - JSONPath: .metadata.managedFields[0].time + name: Modified + priority: 1 + type: date + - JSONPath: .spec.ownerTenant + name: Owner + type: string + - JSONPath: .spec.guestTenants + name: Guest Tenants + priority: 1 + type: string + - JSONPath: .status.status + name: Status + type: string + - JSONPath: .metadata.creationTimestamp + name: Age + type: date group: k8s.netris.ai names: kind: VNet @@ -48,6 +75,8 @@ spec: properties: gateways: items: + description: VNetGateway . + pattern: (^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01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-9]?\d)){3}))|:)))(%.+)?(\/([1-9]|[1-5][0-9]|6[0-4]))?$) type: string type: array name: @@ -57,10 +86,13 @@ spec: description: VNetSwitchPort . properties: name: + pattern: ^[a-zA-Z0-9]+@[a-zA-Z0-9-]+$ type: string state: type: string vlanId: + maximum: 4094 + minimum: 2 type: integer required: - name @@ -71,12 +103,32 @@ spec: type: object type: array state: + enum: + - active + - disabled type: string required: - guestTenants - ownerTenant - sites type: object + status: + description: VNetStatus defines the observed state of VNet + properties: + gateways: + type: string + message: + type: string + sites: + type: string + state: + type: string + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed state + of cluster Important: Run "make" to regenerate code after modifying + this file' + type: string + type: object required: - spec type: object