-
大抵のシンプル化はシステムから要素を取り除くことで実現できる
- すでに利用しなくなったリモートシステムからデータフェッチする処理を削除するだけの場合もあれば、再設計が必要になることもある
- 例えば、2つのシステムが同じリモートデータにアクセスする必要がある場合、2回フェッチする必要があるが、よりシンプルなシステムは1度だけデータをフェッチして結果をフォワードできるかもしれない
-
シンプル化は効率化である
- コンピュータ・ネットワークリソースをセーブする代わりに、エンジニアリングの時間や認知(理解)にかかる負荷を節約する => つまり、未来のリリースにとって有効
-
コードを追加することと、取り除くことは同等に祝福される
- Googleのイントラでは大量のコードを削除したエンジニアのために「Zombie Code Slayer」バッチが飾られている
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin: | |
access_log_path: /tmp/admin_access.log | |
address: | |
socket_address: { address: 0.0.0.0, port_value: 9901 } | |
static_resources: | |
listeners: | |
- name: listener_http | |
address: | |
socket_address: { address: 0.0.0.0, port_value: 80 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<match nginx.access> | |
@type bigquery | |
method insert | |
auth_method json_key | |
json_key /etc/td-agent/bq-key.json | |
project {{ project }} | |
dataset {{ dataset }} | |
table {{ table }} | |
auto_create_table true | |
<inject> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.cloud import bigquery | |
client = bigquery.Client() | |
def bq_import(event, context): | |
"""Triggered by a change to a Cloud Storage bucket. | |
Args: | |
event (dict): Event payload. | |
context (google.cloud.functions.Context): Metadata for the event. | |
""" | |
file = event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: networking.istio.io/v1alpha3 | |
kind: VirtualService | |
metadata: | |
name: nginx-ds | |
namespace: default | |
spec: | |
gateways: | |
- sample-gateway | |
hosts: | |
- "sample.hoge.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nginx-svc | |
namespace: sample-ns | |
labels: | |
name: nginx | |
spec: | |
selector: | |
app: nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: networking.istio.io/v1alpha3 | |
kind: VirtualService | |
metadata: | |
name: nginx-ds | |
namespace: default | |
spec: | |
gateways: | |
- sample-gateway | |
hosts: | |
- "sample.hoge.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: networking.istio.io/v1alpha3 | |
kind: Gateway | |
metadata: | |
name: sample-gateway | |
namespace: default | |
spec: | |
selector: | |
istio: ingressgateway | |
servers: | |
- hosts: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: networking.istio.io/v1alpha3 | |
kind: DestinationRule | |
metadata: | |
name: nginx-dr | |
namespace: default | |
spec: | |
host: nginx-svc.sample-ns.svc.cluster.local | |
subsets: | |
- name: blue | |
labels: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: sample-ns | |
labels: | |
istio-injection: enabled |
NewerOlder