Skip to content

Commit

Permalink
Make manifests usable by Kustomize (#1367)
Browse files Browse the repository at this point in the history
* Add kustomization manifests

* exlcude kustomization.yaml from detect-crds-drift build step
  • Loading branch information
karpoftea authored Oct 26, 2021
1 parent 9a85d4b commit a010501
Show file tree
Hide file tree
Showing 12 changed files with 199 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fmt-check: clean
./.travis.gofmt.sh

detect-crds-drift:
diff -q charts/spark-operator-chart/crds manifest/crds
diff -q charts/spark-operator-chart/crds manifest/crds --exclude=kustomization.yaml

clean:
@echo "cleaning up caches and output"
Expand Down
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions manifest/crds/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- sparkoperator.k8s.io_sparkapplications.yaml
- sparkoperator.k8s.io_scheduledsparkapplications.yaml
23 changes: 23 additions & 0 deletions manifest/spark-application-rbac/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: spark

resources:
- spark-application-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: v1
kind: Namespace
metadata:
name: spark
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: spark
namespace: default
namespace: spark
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: default
namespace: spark
name: spark-role
rules:
- apiGroups: [""]
Expand All @@ -37,11 +41,11 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: spark-role-binding
namespace: default
namespace: spark
subjects:
- kind: ServiceAccount
name: spark
namespace: default
namespace: spark
roleRef:
kind: Role
name: spark-role
Expand Down
25 changes: 25 additions & 0 deletions manifest/spark-operator-install/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: spark-operator

resources:
- spark-operator-rbac.yaml
- ../crds
- spark-operator.yaml
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions manifest/spark-operator-with-webhook-install/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: spark-operator

resources:
- ../spark-operator-install
- spark-operator-webhook.yaml

patchesStrategicMerge:
- spark-operator-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: apps/v1
kind: Deployment
metadata:
name: sparkoperator
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
namespace: spark-operator
spec:
template:
spec:
volumes:
- name: webhook-certs
secret:
secretName: spark-webhook-certs
containers:
- name: sparkoperator
args:
- -logtostderr
- -enable-webhook=true
- -v=2
volumeMounts:
- name: webhook-certs
mountPath: /etc/webhook-certs

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: batch/v1
kind: Job
metadata:
name: sparkoperator-init
namespace: spark-operator
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
spec:
backoffLimit: 3
template:
metadata:
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
spec:
serviceAccountName: sparkoperator
restartPolicy: Never
containers:
- name: main
image: gcr.io/spark-operator/spark-operator:v1beta2-1.2.3-3.1.1
imagePullPolicy: IfNotPresent
command: ["/usr/bin/gencerts.sh", "-p"]
---
kind: Service
apiVersion: v1
metadata:
name: spark-webhook
namespace: spark-operator
spec:
ports:
- port: 443
targetPort: 8080
name: webhook
selector:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1

0 comments on commit a010501

Please sign in to comment.