Git Product home page Git Product logo

example-kustomize's Introduction

Example of Kustomize

Kustomize v3.1.0 の設定例です。

使い方

準備

以下で、チェックアウト及び kustomize のバイナリをダウンロードします。

$ git clone [email protected]:masa213f/example-kustomize.git
$ cd example-kustomize
$ make setup

ビルド

以下でサンプルのビルドができます。

$ bin/example-build examples/<dir>
$ bin/example-diff examples/<dir>

実行例は以下のとおり。ビルド結果とbaseとの差分が表示されます。

$ bin/example-build examples/patch-strategicmerge/
=== kustomize version ===
Version: {KustomizeVersion:3.1.0 GitCommit:95f3303493fdea243ae83b767978092396169baf BuildDate:2019-07-26T18:11:16Z GoOs:linux GoArch:amd64}
=== kustomize build ===
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: hoge
  name: deployment1
spec:
  replicas: 999
  selector:
    matchLabels:
      app: hoge
  template:
    metadata:
      labels:
        app: hoge
    spec:
      containers:
      - command:
        - sh
        - -c
        - sleep 3600
        image: example:2019
        name: example-container
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: piyo
  name: deployment2
spec:
  replicas: 3
  selector:
    matchLabels:
      app: piyo
  template:
    metadata:
      labels:
        app: piyo
    spec:
      containers:
      - command:
        - sh
        - -c
        - sleep 3600
        image: debian:latest
        name: example-container
      - command:
        - sh
        - -c
        - sleep 3600
        image: debian-debug:latest
        name: example-container2
---
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: example
  name: pod1
spec:
  containers:
  - command:
    - sh
    - -c
    - echo $(EXAMPLE_VARIABLE1) $(EXAMPLE_VARIABLE2)
    image: ubuntu:latest
    name: example-container
=== diff base -> target ===
--- /dev/fd/63  2019-10-04 02:23:06.296167257 +0000
+++ /dev/fd/62  2019-10-04 02:23:06.296167257 +0000
@@ -5,7 +5,7 @@
     app: hoge
   name: deployment1
 spec:
-  replicas: 3
+  replicas: 999
   selector:
     matchLabels:
       app: hoge
@@ -19,14 +19,8 @@
         - sh
         - -c
         - sleep 3600
-        image: ubuntu:latest
+        image: example:2019
         name: example-container
-      - command:
-        - sh
-        - -c
-        - sleep 3600
-        image: ubuntu-debug:latest
-        name: example-container2
 ---
 apiVersion: apps/v1
 kind: Deployment

example-kustomize's People

Contributors

masa213f avatar

Watchers

 avatar  avatar

Forkers

zoetrope

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.