Skip to content

Commit 5b5aa3e

Browse files
authored
Update Porch Configs (#2821)
* Use `kubernetes.io/basic-auth` secret type for Git credentials * Assign initial resources and limits to Porch pods * Create emptyDir volume for Porch caches * Pass `--function-runner` flag to Porch server
1 parent 6e783a8 commit 5b5aa3e

File tree

5 files changed

+42
-22
lines changed

5 files changed

+42
-22
lines changed

porch/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ For Git:
6161
```sh
6262
kubectl create secret generic git-repository-auth \
6363
--namespace=default \
64+
--type=kubernetes.io/basic-auth \
6465
--from-literal=username=<GitHub username> \
65-
--from-literal=token=<GitHub Personal Access Token>
66+
--from-literal=password=<GitHub Personal Access Token>
6667
```
6768
* Update the [git-repository.yaml](./config/samples/git-repository.yaml) with your repository address
6869
* Register the repository:

porch/apiserver/pkg/e2e/e2e_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ func (t *PorchSuite) TestGitRepository(ctx context.Context) {
8787
"username": []byte(config.Username),
8888
"password": []byte(config.Password),
8989
},
90-
// TODO: Store as SecretTypeBasicAuth ?
9190
Type: coreapi.SecretTypeBasicAuth,
9291
})
9392

porch/config/deploy/2-function-runner.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,20 @@ spec:
2828
app: function-runner
2929
spec:
3030
containers:
31-
- name: function-runner
32-
image: gcr.io/example-google-project-id/function-runner:latest
33-
imagePullPolicy: Always
34-
ports:
35-
- containerPort: 9445
31+
- name: function-runner
32+
image: gcr.io/example-google-project-id/function-runner:latest
33+
imagePullPolicy: Always
34+
ports:
35+
- containerPort: 9445
36+
resources:
37+
requests:
38+
memory: "32Mi"
39+
cpu: "125m"
40+
limits:
41+
memory: "64Mi"
42+
cpu: "500m"
3643

3744
---
38-
3945
apiVersion: v1
4046
kind: Service
4147
metadata:
@@ -45,6 +51,6 @@ spec:
4551
selector:
4652
app: function-runner
4753
ports:
48-
- port: 9445
49-
protocol: TCP
50-
targetPort: 9445
54+
- port: 9445
55+
protocol: TCP
56+
targetPort: 9445

porch/config/deploy/3-porch-server.yaml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
1615
kind: ServiceAccount
1716
apiVersion: v1
1817
metadata:
1918
name: porch-server
2019
namespace: porch-system
2120

2221
---
23-
2422
apiVersion: apps/v1
2523
kind: Deployment
2624
metadata:
@@ -39,23 +37,38 @@ spec:
3937
apiserver: "true"
4038
spec:
4139
serviceAccountName: porch-server
40+
volumes:
41+
- name: cache-volume
42+
emptyDir: {}
4243
containers:
43-
- name: porch-server
44-
# Update image to the image of your porch apiserver build.
45-
image: gcr.io/example-google-project-id/porch-server:latest
46-
imagePullPolicy: Always
44+
- name: porch-server
45+
# Update image to the image of your porch apiserver build.
46+
image: gcr.io/example-google-project-id/porch-server:latest
47+
imagePullPolicy: Always
48+
resources:
49+
requests:
50+
memory: "64Mi"
51+
cpu: "250m"
52+
limits:
53+
memory: "128Mi"
54+
cpu: "1000m"
55+
volumeMounts:
56+
- mountPath: /cache
57+
name: cache-volume
58+
args:
59+
- --function-runner=function-runner:9445
60+
- --cache-directory=/cache
4761

4862
---
49-
5063
apiVersion: v1
5164
kind: Service
5265
metadata:
5366
name: api
5467
namespace: porch-system
5568
spec:
5669
ports:
57-
- port: 443
58-
protocol: TCP
59-
targetPort: 443
70+
- port: 443
71+
protocol: TCP
72+
targetPort: 443
6073
selector:
6174
apiserver: "true"

porch/config/samples/git-repository.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ spec:
3131
#
3232
# kubectl create secret generic git-repository-auth \
3333
# --namespace=default \
34+
# --type=kubernetes.io/basic-auth \
3435
# --from-literal=username=<GitHub username> \
35-
# --from-literal=token=<GitHub Personal Access Token>
36+
# --from-literal=password=<GitHub Personal Access Token>
3637
name: git-repository-auth

0 commit comments

Comments
 (0)