Skip to content

GitOps

GitOps System Sync facilitates bidirectional synchronization between system configuration and Git repositories. Any configuration changes performed in the Git repository get reflected in the system, and vice versa. This framework ensures a seamless exchange of changes, utilizing external triggers (Pipeline Triggers) for Git modifications and internal triggers whenever the artifact manifests in the Git repo need to be updated. With standardized specs, managing configurations becomes extremely efficient.

Here are some examples of specs for Environment Manager resources for system sync operations:

Drivers

Container Drivers

Volume Restore & Backup

Below is an example YAML configuration file for a Container Driver created in the project demoproject where, - the driver is shared - environment variables and files are included - outOfCluster and volumesBackupAndRestore are set to true

apiVersion: eaas.envmgmt.io/v1
kind: Driver
metadata:
  description: This is a driver
  name: driver-demo
  project: demoproject
spec:
  config:
    container:
      arguments:
      - refresh=true
      - arg2
      commands:
      - command1
      - command2
      cpuLimitMilli: "100"
      envVars:
        envvar1: sealed://driverconfig.container.envs.envvar1
        envvar2: sealed://driverconfig.container.envs.envvar2
      files:
        filename: c2VhbGVkOi8vZHJpdmVyY29uZmlnLmNvbnRhaW5lci5maWxlcy5maWxlbmFtZQ==
      image: image
      imagePullCredentials:
        password: sealed://registry_credentials
        registry: registry
        username: username
      kubeConfigOptions:
        kubeConfig: sealed://cluster_kubeconfig
        outOfCluster: true
      kubeOptions:
        labels:
          key1: val1
          key2: val2
        namespace: ns
        nodeSelector:
          node1key: node1val
          node2key: node2val
        securityContext:
          privileged: true
          readOnlyRootFileSystem: true
        serviceAccountName: sa
      memoryLimitMb: "102"
      volumes:
      - mountPath: /tmp2
      - mountPath: /tmp-pvc
        pvcSizeGB: "2"
        pvcStorageClass: gp2
        usePVC: true
      - enableBackupAndRestore: true
        mountPath: /tmp3
      workingDirPath: working/dir/path
    successCondition: success condition
    timeoutSeconds: 3600
    type: container
  secret:
    name: file://artifacts/new/sealed-secret.yaml
  sharing:
    enabled: true
    projects:
    - name: defaultproject

HTTP Drivers

apiVersion: eaas.envmgmt.io/v1
kind: Driver
metadata:
  description: This is a driver of HTTP type
  name: demo-http-driver
  project: demo-project
spec:
  config:
    http:
      body: <h1>This is a heading</h1>
      endpoint: https://example.com
      headers:
        Content-type: application/javascript
        X-TOKEN: token
      method: GET
    maxRetryCount: 2
    successCondition: 200ok
    timeoutSeconds: 12
    type: http

Context

apiVersion: eaas.envmgmt.io/v1
kind: ConfigContext
metadata:
  name: demo-context
  project: demo-project
spec:
  envs:
  - key: AWS_ACCESS_KEY_ID
    sensitive: true
    value: key
  - key: AWS_SECRET_ACCESS_KEY
    sensitive: true
    value: secret
  - key: DRIVER_DEBUG
    value: "true"
  files:
  - data: <file data>
    sensitive: true
  variables:
  - name: rafay_config_file
    value: config.json
    valueType: text    

Static Resource

apiVersion: eaas.envmgmt.io/v1
kind: Resource
metadata:
  name: demo-static-resource
  project: demo-project
spec:
  variables:
  - name: name
    value: value
    valueType: text

Resource Template

:simple-codereview: Volume Restore & Backup - Coming Soon

Below is an example YAML configuration file for a Resource Template created in the project demoproject with the agent sp-agent and volumeBackupandrestore set to true

apiVersion: eaas.envmgmt.io/v1
kind: ResourceTemplate
metadata:
  description: This is a resource environment template
  name: demo-resource-temp
  project: demoproject
spec:
  agents:
  - name: sp-agent
  contexts:
  - name: aws-creds-tf9
  - name: eks-config-tf9
  - name: rctl-config-tf9
  hooks: {}
  provider: terraform
  providerOptions:
    driver:
      name: demo-driver
    terraform:
      backendType: system
      volumes:
      - enableBackupAndRestore: true
        mountPath: /temp1/mount
      - enableBackupAndRestore: true
        mountPath: /temp2/mount
        pvcSizeGB: "4"
        pvcStorageClass: gp2
        usePVC: true
      version: v1.5.7
  repositoryOptions:
    branch: main
    directoryPath: cloud-creds
    name: demo-envmgr
  version: v1
  versionState: active

Environment Template

apiVersion: eaas.envmgmt.io/v1
kind: EnvironmentTemplate
metadata:
  description: This is an environment template
  name: demo-env-temp
  project: demo-project
  displayName: demo-displayname
spec:
  iconURL: url
  readme: |-
    readme line1
    readme line2
    readme line3
  agents:
  - name: demo-agent
  resources:
  - kind: resourcetemplate
    name: demo-eks
    resourceOptions:
      version: v1
    type: dynamic
  version: v1
  versionState: active

Environment

apiVersion: eaas.envmgmt.io/v1
kind: Environment
metadata:
  description: This is an environment
  name: demo-env1
  project: demo-project
spec:
  template:
    name: demo-env1
    version: v1