Skip to content

Commit 8d48dc0

Browse files
Makefile support to deploy sample Istio with ambient profile (openshift-service-mesh#546)
* Makefile support to deploy sample Istio with ambient profile Updated makefile commands: Deployment deploy-istio Deploy a sample Istio resource (without CNI) to an existing cluster. deploy-istio-with-cni Deploy a sample Istio and IstioCNI resource to an existing cluster. deploy-istio-with-ambient Deploy necessary Istio resources using the ambient profile. Fixes: istio-ecosystem#545 Signed-off-by: Sridhar Gaddam <[email protected]> * Rename istio-sample-openshift.yaml to istio-sample.yaml Signed-off-by: Sridhar Gaddam <[email protected]> --------- Signed-off-by: Sridhar Gaddam <[email protected]>
1 parent 162b031 commit 8d48dc0

File tree

8 files changed

+21
-50
lines changed

8 files changed

+21
-50
lines changed

Makefile.core.mk

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,20 +343,26 @@ undeploy-olm: verify-kubeconfig operator-sdk ## Undeploy the operator from an ex
343343
kubectl delete ztunnel.sailoperator.io --all --all-namespaces --wait=true
344344
$(OPERATOR_SDK) cleanup $(OPERATOR_NAME) --delete-all -n ${NAMESPACE}
345345

346-
.PHONY: deploy-example
347-
deploy-example: deploy-example-openshift ## Deploy an example Istio resource to an existing OCP cluster. Same as `deploy-example-openshift`.
346+
.PHONY: deploy-istio
347+
deploy-istio: verify-kubeconfig ## Deploy a sample Istio resource (without CNI) to an existing cluster.
348+
kubectl create ns istio-system || echo "namespace istio-system already exists"
349+
kubectl apply -f chart/samples/istio-sample.yaml
348350

349-
.PHONY: deploy-example-openshift
350-
deploy-example-openshift: verify-kubeconfig ## Deploy an example Istio and IstioCNI resource to an existing OCP cluster.
351+
.PHONY: deploy-istio-with-cni
352+
deploy-istio-with-cni: verify-kubeconfig ## Deploy a sample Istio and IstioCNI resource to an existing cluster.
351353
kubectl create ns istio-cni || echo "namespace istio-cni already exists"
352354
kubectl apply -f chart/samples/istiocni-sample.yaml
353355
kubectl create ns istio-system || echo "namespace istio-system already exists"
354-
kubectl apply -f chart/samples/istio-sample-openshift.yaml
356+
kubectl apply -f chart/samples/istio-sample.yaml
355357

356-
.PHONY: deploy-example-kubernetes
357-
deploy-example-kubernetes: verify-kubeconfig ## Deploy an example Istio resource on an existing cluster.
358+
.PHONY: deploy-istio-with-ambient
359+
deploy-istio-with-ambient: verify-kubeconfig ## Deploy necessary Istio resources using the ambient profile.
358360
kubectl create ns istio-system || echo "namespace istio-system already exists"
359-
kubectl apply -f chart/samples/istio-sample-kubernetes.yaml
361+
kubectl apply -f chart/samples/ambient/istio-sample.yaml
362+
kubectl create ns istio-cni || echo "namespace istio-cni already exists"
363+
kubectl apply -f chart/samples/ambient/istiocni-sample.yaml
364+
kubectl create ns ztunnel || echo "namespace zunnel already exists"
365+
kubectl apply -f chart/samples/ambient/istioztunnel-sample.yaml
360366

361367
##@ Generated Code & Resources
362368

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,10 @@ Make sure that the `HUB` and `TAG` environment variables point to your container
9999

100100
Create an instance of the `Istio` resource to install the Istio Control Plane.
101101

102-
Use the `istio-sample-kubernetes.yaml` file on vanilla Kubernetes:
103-
104-
```sh
105-
# Create the istio-system namespace if it does not exist
106-
kubectl create ns istio-system
107-
kubectl apply -f chart/samples/istio-sample-kubernetes.yaml
108-
```
109-
110-
Use the `istio-sample-openshift.yaml` file on OpenShift:
111-
112102
```sh
113103
# Create the istio-system namespace if it does not exist
114104
kubectl create ns istio-system
115-
kubectl apply -f chart/samples/istio-sample-openshift.yaml
105+
kubectl apply -f chart/samples/istio-sample.yaml
116106
```
117107

118108
On OpenShift, you must also deploy the Istio CNI plugin by creating an instance of the `IstioCNI` resource:

chart/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ The `sail-operator` charts directory contains `samples` directory, which contain
124124
* Kubernetes
125125

126126
```sh
127-
$ kubectl apply -f sail-operator/samples/istio-sample-kubernetes.yaml
127+
$ kubectl apply -f sail-operator/samples/istio-sample.yaml
128128
```
129129

130130
* OpenShift
131131

132132
```sh
133-
$ kubectl apply -f sail-operator/samples/istio-sample-openshift.yaml
133+
$ kubectl apply -f sail-operator/samples/istio-sample.yaml
134134
$ kubectl apply -f sail-operator/samples/istiocni-sample.yaml
135135
```
136136

chart/samples/istio-sample-kubernetes.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

chart/templates/olm/samples.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
{{ if and .Values.bundleGeneration (eq .Values.platform "openshift") }}
2-
{{ .Files.Get "samples/istio-sample-openshift.yaml" }}
3-
---
4-
{{ .Files.Get "samples/istiocni-sample.yaml" }}
5-
{{ else if .Values.bundleGeneration }}
6-
{{ .Files.Get "samples/istio-sample-kubernetes.yaml" }}
1+
{{ if .Values.bundleGeneration }}
2+
{{ .Files.Get "samples/istio-sample.yaml" }}
73
---
84
{{ .Files.Get "samples/istiocni-sample.yaml" }}
95
{{ end }}

hack/update-version-list.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function updateVersionInSamples() {
8888

8989
sed -i -E \
9090
-e "s/version: .*/version: $defaultVersion/g" \
91-
chart/samples/istio-sample-kubernetes.yaml chart/samples/istio-sample-openshift.yaml chart/samples/istiocni-sample.yaml
91+
chart/samples/istio-sample.yaml chart/samples/istiocni-sample.yaml
9292
}
9393

9494
updateVersionsInIstioTypeComment

tests/e2e/common-operator-integ-suite.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,14 @@ initialize_variables() {
121121
LOCALBIN="${LOCALBIN:-${HOME}/bin}"
122122
OPERATOR_SDK=${LOCALBIN}/operator-sdk
123123
IP_FAMILY=${IP_FAMILY:-ipv4}
124+
ISTIO_MANIFEST="chart/samples/istio-sample.yaml"
124125

125126
if [ "${OCP}" == "true" ]; then
126127
COMMAND="oc"
127128
fi
128129

129130
echo "Using command: ${COMMAND}"
130131

131-
if [ "${OCP}" == "true" ]; then
132-
ISTIO_MANIFEST="chart/samples/istio-sample-openshift.yaml"
133-
else
134-
ISTIO_MANIFEST="chart/samples/istio-sample-kubernetes.yaml"
135-
fi
136-
137132
echo "Setting Istio manifest file: ${ISTIO_MANIFEST}"
138133
ISTIO_NAME=$(yq eval '.metadata.name' "${WD}/../../$ISTIO_MANIFEST")
139134

0 commit comments

Comments
 (0)