Git Product home page Git Product logo

linkerd2-libsonnet's Introduction

linkerd2-libsonnet

Generates production-ready manifests for:

  • linkerd2 (Not OpenSource yet)
  • linkerd2-viz (Not OpenSource yet)
  • linkerd2-cni (edge-23.4.1 + local install-cni.sh patch. See: linkerd/linkerd2#10669 )

Getting started

If you use Homebrew:

brew install vmware-tanzu/carvel/vendir jsonnet-bundler tanka
tk init --k8s 1.24
jb install github.com/cloud-destroyer/linkerd2-libsonnet

# Add the needed locally vendored chart(s):
cd vendor/linkerd2-libsonnet
make

Using the Jsonnet library in a Tanka environment

Running tk init should have created a file in environments/default/main.jsonnet. Edit it:

local linkerd2_cni = import 'linkerd2-libsonnet/linkerd2-cni.libsonnet';

linkerd2_cni {

}

Generate or show the manifests

# Show the manifests ...
tk show environments/default

# Export them to a manifests/ folder ...
tk export manifests/ environments/default

Apply the manifests to a cluster

The many ways of accomplishing this is way beyond what any mortal can comprehend. But here's an example using kapp from Carvel:

# Need to delete this manifest file because kapp attempts to parse it as well
rm manifests/manifest.json

# kapp deploy
kapp deploy -a linkerd2-cni -f manifests/


# kapp deploy with showing diff
kapp deploy -a linkerd2-cni -f manifests/ --diff-changes

Customizing the deployment

See config.libsonnet for the specific configuration values linkerd2-libsonnet supports.

On top of what this library directly supports, you can also customize all the Helm chart values directly in $._config.linkerd2_cni.values.

There is special handling needed for changing the namespace when enablePSP is set to true. See example below for using a custom-namespace:

local k = import 'k.libsonnet';
local linkerd2_cni = import 'linkerd2-libsonnet/linkerd2-cni.libsonnet';

linkerd2_cni {
  _config+: {
    linkerd2_cni+: {
      enablePSP: true,
      namespace: 'custom-namespace',
      iKnowWhatImDoing: true,
      values+: {

      },
    },
  },
} + {
  helm_template+: {

    // This manual field override using custom naming of the field name is needed if
    // the namespace is something other than 'linkerd-cni'.
    pod_security_policy_linkerd_custom_namespace_cni+:
      k.policy.v1beta1.podSecurityPolicy.spec.withVolumesMixin(['configMap']),
  },

}

linkerd2-libsonnet's People

Contributors

frimik avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.