From 01c47bfa18d89d9bfd4ce217a96e94d17da20775 Mon Sep 17 00:00:00 2001 From: NEM-NE Date: Tue, 6 Sep 2022 22:25:54 +0900 Subject: [PATCH 1/4] feat: check ingress enabled using value config --- charts/istio/dev-values.yaml | 3 +++ charts/istio/templates/ingress.yaml | 4 +++- charts/istio/values.yaml | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/istio/dev-values.yaml b/charts/istio/dev-values.yaml index 842acd5..760b6ce 100644 --- a/charts/istio/dev-values.yaml +++ b/charts/istio/dev-values.yaml @@ -1,3 +1,6 @@ +ingress: + enabled: false + istio-gateway: tolerations: - key: kind diff --git a/charts/istio/templates/ingress.yaml b/charts/istio/templates/ingress.yaml index 8cb8a80..82ff249 100644 --- a/charts/istio/templates/ingress.yaml +++ b/charts/istio/templates/ingress.yaml @@ -1,3 +1,4 @@ +{{ if .Values.ingress.enabled }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -28,4 +29,5 @@ spec: service: name: istio-gateway port: - number: 80 \ No newline at end of file + number: 80 +{{ end -}} \ No newline at end of file diff --git a/charts/istio/values.yaml b/charts/istio/values.yaml index 3f299bb..7f6d205 100644 --- a/charts/istio/values.yaml +++ b/charts/istio/values.yaml @@ -1,2 +1,5 @@ +ingress: + enabled: false + istio-gateway: {} istiod: {} From f3387622da50c2c4ebd76b225568f2ea02701a08 Mon Sep 17 00:00:00 2001 From: NEM-NE Date: Tue, 6 Sep 2022 22:26:09 +0900 Subject: [PATCH 2/4] feat: create prod values config --- charts/istio/prod-values.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 charts/istio/prod-values.yaml diff --git a/charts/istio/prod-values.yaml b/charts/istio/prod-values.yaml new file mode 100644 index 0000000..f6ccc62 --- /dev/null +++ b/charts/istio/prod-values.yaml @@ -0,0 +1,2 @@ +ingress: + enabled: true From f389a23dcfe68692f57f5c5d27e64e71ffc3f2ae Mon Sep 17 00:00:00 2001 From: NEM-NE Date: Tue, 6 Sep 2022 22:27:09 +0900 Subject: [PATCH 3/4] feat: add vender, env config in values config --- charts/istio/dev-values.yaml | 4 ++++ charts/istio/prod-values.yaml | 4 ++++ charts/istio/values.yaml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/charts/istio/dev-values.yaml b/charts/istio/dev-values.yaml index 760b6ce..ae880fb 100644 --- a/charts/istio/dev-values.yaml +++ b/charts/istio/dev-values.yaml @@ -1,3 +1,7 @@ +vender: "AWS" # AWS | on-premise + +environment: "develop" + ingress: enabled: false diff --git a/charts/istio/prod-values.yaml b/charts/istio/prod-values.yaml index f6ccc62..1389593 100644 --- a/charts/istio/prod-values.yaml +++ b/charts/istio/prod-values.yaml @@ -1,2 +1,6 @@ +vender: "AWS" # AWS | on-premise + +environment: "production" + ingress: enabled: true diff --git a/charts/istio/values.yaml b/charts/istio/values.yaml index 7f6d205..4a6e353 100644 --- a/charts/istio/values.yaml +++ b/charts/istio/values.yaml @@ -1,3 +1,7 @@ +vender: "AWS" # AWS | on-premise + +environment: "develop" + ingress: enabled: false From 2675734383727d8003c72f6391d121f0ab42013b Mon Sep 17 00:00:00 2001 From: NEM-NE Date: Tue, 6 Sep 2022 22:41:15 +0900 Subject: [PATCH 4/4] feat: separate istio ingress annotation --- charts/istio/prod-values.yaml | 10 ++++++++++ charts/istio/templates/ingress.yaml | 12 +++--------- charts/istio/values.yaml | 1 + 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/charts/istio/prod-values.yaml b/charts/istio/prod-values.yaml index 1389593..3fb7bb1 100644 --- a/charts/istio/prod-values.yaml +++ b/charts/istio/prod-values.yaml @@ -4,3 +4,13 @@ environment: "production" ingress: enabled: true + annotations: + kubernetes.io/ingress.class: alb + alb.ingress.kubernetes.io/target-type: instance + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/healthcheck-protocol: HTTPS + alb.ingress.kubernetes.io/healthcheck-port: "443" + alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]' + alb.ingress.kubernetes.io/ssl-redirect: "443" + alb.ingress.kubernetes.io/certificate-arn: "arn:aws:acm:ap-northeast-2:089143290485:certificate/8f20bc85-876b-47a2-8c9f-27e9f5455ca9" + external-dns.alpha.kubernetes.io/hostname: "*.so1s.io" diff --git a/charts/istio/templates/ingress.yaml b/charts/istio/templates/ingress.yaml index 82ff249..ad21ce0 100644 --- a/charts/istio/templates/ingress.yaml +++ b/charts/istio/templates/ingress.yaml @@ -4,16 +4,10 @@ kind: Ingress metadata: name: istio-ingress namespace: istio-system + {{- if .Values.ingress.annotations }} annotations: - kubernetes.io/ingress.class: alb - alb.ingress.kubernetes.io/target-type: instance - alb.ingress.kubernetes.io/scheme: internet-facing - alb.ingress.kubernetes.io/healthcheck-protocol: HTTPS - alb.ingress.kubernetes.io/healthcheck-port: '443' - alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]' - alb.ingress.kubernetes.io/ssl-redirect: '443' - alb.ingress.kubernetes.io/certificate-arn: "arn:aws:acm:ap-northeast-2:089143290485:certificate/8f20bc85-876b-47a2-8c9f-27e9f5455ca9" - external-dns.alpha.kubernetes.io/hostname: "*.so1s.io" + {{- toYaml .Values.ingress.annotations | nindent 4 }} + {{- end }} spec: defaultBackend: service: diff --git a/charts/istio/values.yaml b/charts/istio/values.yaml index 4a6e353..296c17a 100644 --- a/charts/istio/values.yaml +++ b/charts/istio/values.yaml @@ -4,6 +4,7 @@ environment: "develop" ingress: enabled: false + annotations: {} istio-gateway: {} istiod: {}