Skip to content
Snippets Groups Projects
  1. Mar 16, 2018
  2. Mar 15, 2018
  3. Mar 13, 2018
  4. Mar 07, 2018
  5. Mar 05, 2018
  6. Feb 26, 2018
    • Jessica Yuen's avatar
      Set param boolean types as strings · daf10a0a
      Jessica Yuen authored
      
      Fixes #311
      
      There currently exists a discrepency between the param types expected
      from:
      1. The parts library and in generate / prototype use
      2. ks param set
      
      ks param set will set boolean types as jsonnet boolean types, however,
      prototypes will set boolean types as strings (i.e. in quotes). This
      change will make it such that ks param sets boolean types as strings.
      The reason we're not setting booleans in both model is because that will
      require a better dependency story around ksonnet/parts first.
      
      Signed-off-by: default avatarJessica Yuen <im.jessicayuen@gmail.com>
      daf10a0a
  7. Feb 23, 2018
    • Jessica Yuen's avatar
      App spec to take a single destination · 936e31ab
      Jessica Yuen authored
      
      Currently the app.yaml spec takes a list of destinations. The change
      exists to anticipate support for an environment supporting multiple
      clusters or "destinations". The problem is, while the use case makes
      sense for `apply`, and `delete`, it becomes ambiguous which cluster is
      being referred to during commands such as `diff`. We've considered
      specifying a cluster during a `diff`, however, ks currently doesn't have
      a notion of a cluster identity. This change is to update the app.yaml to
      take a single destination to more accurately represent the state of
      things.
      
      Signed-off-by: default avatarJessica Yuen <im.jessicayuen@gmail.com>
      936e31ab
  8. Feb 21, 2018
  9. Feb 17, 2018
  10. Feb 08, 2018
  11. Feb 02, 2018
    • Jessica Yuen's avatar
      Migrate environment spec.json to the app.yaml model · 19b3b928
      Jessica Yuen authored
      Currently spec.json contains detail about an environment's namespace and
      server. Following the proposal at
      design/proposals/modular-components.md, this change will consolidate
      environment specifications in the common ksonnet app.yaml file.
      
      An environment specification for the environment "dev", may look as
      follows:
      
      environments:
        dev:
          destinations:
          - namespace: foo
            server: example.com
          k8sVersion: "1.8.1"
          path: dev
          targets:
          - db
      
      Note: This change currently doesn't support
      
      (1) population of the k8sVersion field. This will occur as we migrate
      the environment .metadata folder.
      (2) deployment to more than one destination. This will occur once ks
      supports multi-cluster deployment.
      (3) setting of details other than the env name in `ks env set`. Prior
      to this change, users are able to namespace and server URI, however it
      becomes ambiguous which namespace is being set for an environment where
      there can be multiple destinations. ...
      19b3b928
  12. Jan 25, 2018
  13. Jan 22, 2018
    • Jessica Yuen's avatar
      Add remove component functionality · 8f26d9a4
      Jessica Yuen authored
      
      Introduce `ks component rm <component>`. This functionality will:
      
      1. Delete the component file from components/. This is determined by the
      component file name. If there exists two files with the same name but
      different file  extensions, we will error out.
      
      2. Remove component references. This currently implies removing all
      component referenes in the component/params.libsonnet file and the
      environment-specific params.libsonnet files.
      
      Signed-off-by: default avatarJessica Yuen <im.jessicayuen@gmail.com>
      8f26d9a4
  14. Jan 08, 2018
  15. Jan 05, 2018
  16. Dec 15, 2017
    • Jessica Yuen's avatar
      Implement command `ks registry add` · 4e0b163e
      Jessica Yuen authored
      
      Currently users are unable to add their own registries through the CLI.
      This limits them to a small subset of prototypes found in the default
      incubator registry.
      
      This commit will add the command `ks registry add`, that allows users to
      add registries supporting the `github` protocol.
      
      It will be of the form `ks registry add <registry-name> <registry-uri>
      [--version]`. If a version is not specified, `latest` will be used.
      
      Signed-off-by: default avatarJessica Yuen <im.jessicayuen@gmail.com>
      4e0b163e
  17. Nov 22, 2017
    • Jessica Yuen's avatar
      Improve logging for init · 97631513
      Jessica Yuen authored
      - Add message:  Creating a new app 'foo' at path '/path/to/foo'
      - On success, add message:  ksonnet app successfully created! Next, try
        creating a component with `ks generate`
      - On failure, provide suggestions for the user.
      - Make note that the context is retrieved from the kubeconfig file at
        the environment variable $KUBECONFIG
      97631513
  18. Nov 13, 2017
    • Jessica Yuen's avatar
      Use background colors for param diff · 2fcbf68b
      Jessica Yuen authored
      Foreground colors were causing conflicts with user's terminal colors.
      i.e. Black text would show as invisible for users with a black terminal
      background.
      2fcbf68b
  19. Nov 10, 2017
    • Alex Clemmer's avatar
      💅 Add row-padding string pretty printer · 9c2d0a2d
      Alex Clemmer authored
      Historically, every time we've needed to write out something tabular,
      we've hand-rolled an ad hoc padded row writer. Yes, in each case. Such
      is #startuplife.
      
      The third time we did this we wrote this with bugs, and so now we are
      rewriting it in a general, tested function, and transitioning all places
      where we call this to use this function.
      9c2d0a2d
  20. Nov 06, 2017
    • Alex Clemmer's avatar
      Emit `app.yaml` after init · 4dd0dd7a
      Alex Clemmer authored
      When the user calls `ks init <whatever>`, we need to emit an `app.yaml`
      for the new project. This commit will introduce such behavior.
      4dd0dd7a
  21. Nov 04, 2017
    • Jessica Yuen's avatar
      Introduce command: `ks param diff <env1> <env2> [--component]` · 6a6704fc
      Jessica Yuen authored
      Pretty prints differences between the component parameters of two
      environments.
      
      A component flag is accepted to diff against a single component. By
      default, the diff is performed against all components.
      6a6704fc
    • Jessica Yuen's avatar
      Introduce command: 'ks param list [component] [--env=<env>]' · eabd30c5
      Jessica Yuen authored
      Pretty prints component or environment parameters.
      
      This command will display all parameters for the component specified. If
      a component is not specified, parameters for all components will be
      listed.
      
      Furthermore, parameters can be listed on a per-environment basis.
      
      Examples:
      
      List all component parameters
        ks param list
      
      List all parameters for the component "guestbook"
        ks param list guestbook
      
      List all parameters for the environment "dev"
        ks param list --env=dev
      
      List all parameters for the component "guestbook" in the environment
      "dev"
        ks param list guestbook --env=dev`,
      eabd30c5
    • Jessica Yuen's avatar
      Introduce commands: 'ks param' and 'ks param set' · 8fc6c76c
      Jessica Yuen authored
      Parameters are the customizable fields defining ksonnet components. For
      example, replica count, component name, or deployment image.
      
      Parameters are also able to be defined separately across environments.
      Meaning, this supports features to allow a "development" environment to
      only run a single replication instance for it's components, whereas
      allowing a "production" environment to run more replication instances to
      meet heavier production load demands.
      
      'ks param set' is defined as follows:
        'ks param set <component-name> <param-key> <param-value>'
      
      Examples:
      
      Updates the replica count of the 'guestbook' component to 4.
        'ks param set guestbook replicas 4'
      
      Updates the replica count of the 'guestbook' component to 2 for the
      environment 'dev'
        'ks param set guestbook replicas 2 --env=dev'
      8fc6c76c
  22. Oct 26, 2017
    • Jessica Yuen's avatar
      Rename environment uri references to server · 3c9e07e9
      Jessica Yuen authored
      'server' is consistent with what is used by clientgo. 'uri' only
      introduces new language to ksonnet with the same meaning.
      3c9e07e9
    • Jessica Yuen's avatar
      Support `diff` between two environments · 2687c6d8
      Jessica Yuen authored
      This change enables the user to diff between two environments that are
      either local or remote.
      
      i.e.,
      
      `kubecfg diff local:dev local:prod` will diff between the expanded
      templates for each environment on disk.
      
      `kubecfg diff remote:dev remote:prod` will diff between two remote
      environment clusters. It does this by first expanding the component
      templates of each environment. Then, the live objects are fetched from
      each of the clusters and the diff is performed against the live objects.
      
      `kubecfg diff local:dev remote:prod` is also an option. This will diff
      between the expanded templates for 'dev' on disk and the live objects
      on 'prod's server.
      2687c6d8
  23. Oct 17, 2017
    • Jessica Yuen's avatar
    • Jessica Yuen's avatar
      Introduce namespace to environments · 38f35db4
      Jessica Yuen authored
      Environments currently have the concept of a server URI, but it is
      ambiguous which cluster namespace to use.
      
      This commit will introduce the concept of namespaces to the env
      commands.
      
      For example,
      `kubecfg env add staging http://mock-staging-uri \
       --namespace=staging-namespace`
      `kubecfg env set staging --namespace=staging-namespace`
      
      The default environment will use the namespace of the default context.
      
      This commit will also update commands that take the <env> arg such as
      `apply` to make use of the env namespace, if specified.
      38f35db4
  24. Sep 21, 2017
    • Alex Clemmer's avatar
      Cause `init` to generate env using current-context · 361a62c0
      Alex Clemmer authored
      When we run `init`, currently we generate a simple environment called
      'default' with no URI. A better idea is to generate the URI from the
      current context of the active kubeconfig file, if it exists.
      361a62c0
    • Jessica Yuen's avatar
      Commands using the <env> arg should deploy to the correct cluster · 13f89a92
      Jessica Yuen authored
      For example, 'apply <env' currently operates as a no-op. With the
      introduction of simple environments in PR #131, 'apply <env>' should
      perform basic validation such that:
      
      1. The user has added the environment that is being deployed against to
      their Ksonnet project.
      
      2. The URI in the environment's spec file that the user wishes to deploy
      to should correspond to at least one cluster location as listed in
      kubeconfig.
      
      If either of those conditions are not satisfied, the kubecfg user will
      receive the corresponding error.
      
      In addition, this commit will set the kubectl --cluster flag to point at
      the cluster listed by the environment URI.
      13f89a92
  25. Sep 19, 2017
    • Jessica Yuen's avatar
      Logging for env subcommands · 5e63dcba
      Jessica Yuen authored
      This commit will add logging to all env subcommands 'list', 'set',
      'add', and 'rm'. It adds both Info level and Debug level logging.
      
      Fixes #137
      5e63dcba
  26. Sep 18, 2017
    • Jessica Yuen's avatar
      Add subcommand 'env set' · f86667a6
      Jessica Yuen authored
      'env set <name>' sets environment fields such as the name, and cluster
      URI. It currently accepts the flags '--name' and '--uri'. Changing the
      name of an environment will also update the directory structure in
      'environments'.
      f86667a6
  27. Sep 15, 2017
    • Jessica Yuen's avatar
      Add subcommand 'env rm' · 530f5777
      Jessica Yuen authored
      'env rm <env-name>' deletes an environment within a ksonnet project.
      This is the same as removing the <env-name> environment directory and
      all files contained.  Empty parent directories will also be removed.
      530f5777
    • Jessica Yuen's avatar
      Add subcommand 'env list' · a169d973
      Jessica Yuen authored
      'env list' will list all environments within a Ksonnet project. Each
      environment will be pretty-printed with it's name and cluster URI
      location.
      a169d973
  28. Sep 13, 2017
    • Jessica Yuen's avatar
      Add subcommand 'env add' · 56777310
      Jessica Yuen authored
      'env add <env-name> <env-uri>' will create a new environment within a
      ksonnet project, by generating a new directory, 'env-name', within the
      'envs' directory. Each environment will contain environment-specfic
      files. Notably, a new environment-specific file is 'spec.json'.
      'spec.json' currently only contains the 'env-uri' of the Kubernetes
      cluster located at the added environment.
      
      Below is an example directory structure for the environment
      'us-west/staging':
      
      app-name/
        .gitignore           Default .gitignore; can customize VCS
        .ksonnet/            Metadata for ksonnet
        environments/        Env specs (defaults: dev, test, prod)
          default/           [Default generated environment.]
          us-west/           [Example of user-generated env]
            staging/
              k.libsonnet
              k8s.libsonnet
              swagger.json
              spec.json      [This will contain the uri of the environment]
        components/          Top-level Kubernetes objects defining application
        lib/                 user-written .libsonnet files
        vendor/              mixin libraries, prototypes
      56777310
  29. Sep 07, 2017
    • Alex Clemmer's avatar
      Deprecate `update` subcommand; introduce `apply` · 94a18089
      Alex Clemmer authored
      This commit is a follow-up to the discussion in the ksonnet.next design
      doc, in which users consistently expressed their preference that the
      `update` command be called `apply`.
      
      NOTE: We have renamed `pkg/kubecfg/update_test.go` ->
      `pkg/kubecfg/apply_test.go`, but we copy the `update`'s integration test
      file. The reason is that the `update` unit tests actually test things
      like GC (rather than the command itself), so the file name is
      inconsequential. On the other hand, the integration tests test the
      commands themselves, so it is important to have two copies, one for
      `update` and one for `apply`.
      94a18089
    • Alex Clemmer's avatar
      Include `lib/` and `vendor/lib` when expanding templates · bc77be8e
      Alex Clemmer authored
      Currently, if the user wants to deploy a ksonnet application, and that
      application uses some vendored library, or something in the `lib/`
      directory, they will have to pass the appropriate `-J` flags into the
      command themselves.
      
      This commit will automatically add these whenever we're in an app
      directory and a command is issued. In particular, even if the user
      passes in the `-f` flag (rather than an environment name), we'll still
      add library paths to the command if we're in a ksonnet app directory.
      This is meant to capture the case that a user wants to update one
      resource in particular in a ksonnet application.
      bc77be8e