Skip to content

Commit

Permalink
Refactoring with new name
Browse files Browse the repository at this point in the history
  • Loading branch information
dlakhaws committed Oct 27, 2023
1 parent fcc3bce commit 490d1be
Show file tree
Hide file tree
Showing 19 changed files with 73 additions and 35 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN gpg --verify mount-s3.rpm.asc

# Build driver
FROM --platform=$BUILDPLATFORM golang:1.21.1-bullseye as builder
WORKDIR /go/src/github.com/kubernetes-sigs/aws-s3-csi-driver
WORKDIR /go/src/github.com/awslabs/mountpoint-s3-csi-driver
ADD . .
RUN make bin

Expand All @@ -51,6 +51,6 @@ RUN dnf upgrade -y && \
RUN echo "user_allow_other" >> /etc/fuse.conf

# Install driver
COPY --from=builder /go/src/github.com/kubernetes-sigs/aws-s3-csi-driver/bin/aws-s3-csi-driver /bin/aws-s3-csi-driver
COPY --from=builder /go/src/github.com/awslabs/mountpoint-s3-csi-driver/bin/aws-mountpoint-s3-csi-driver /bin/aws-mountpoint-s3-csi-driver

ENTRYPOINT ["/bin/aws-s3-csi-driver"]
ENTRYPOINT ["/bin/aws-mountpoint-s3-csi-driver"]
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SHELL = /bin/bash

VERSION=0.1.0

PKG=github.com/awslabs/aws-s3-csi-driver
PKG=github.com/awslabs/mountpoint-s3-csi-driver
GIT_COMMIT?=$(shell git rev-parse HEAD)
BUILD_DATE?=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")

Expand All @@ -28,7 +28,7 @@ GOOS=$(shell go env GOOS)
GOBIN=$(shell pwd)/bin

REGISTRY?=""
IMAGE?=$(REGISTRY)/s3-csi-driver
IMAGE?=$(REGISTRY)/mountpoint-s3-csi-driver
TAG?=$(GIT_COMMIT)

PLATFORM?=linux/amd64,linux/arm64
Expand All @@ -55,7 +55,7 @@ login_registry:
.PHONY: bin
bin:
mkdir -p bin
CGO_ENABLED=0 GOOS=linux go build -ldflags ${LDFLAGS} -o bin/aws-s3-csi-driver ./cmd/
CGO_ENABLED=0 GOOS=linux go build -ldflags ${LDFLAGS} -o bin/aws-mountpoint-s3-csi-driver ./cmd/

.PHONY: test
test:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "aws-s3-csi-driver.name" -}}
{{- define "aws-mountpoint-s3-csi-driver.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

Expand All @@ -11,7 +11,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "aws-s3-csi-driver.fullname" -}}
{{- define "aws-mountpoint-s3-csi-driver.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
Expand All @@ -27,17 +27,17 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "aws-s3-csi-driver.chart" -}}
{{- define "aws-mountpoint-s3-csi-driver.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "aws-s3-csi-driver.labels" -}}
{{ include "aws-s3-csi-driver.selectorLabels" . }}
{{- define "aws-mountpoint-s3-csi-driver.labels" -}}
{{ include "aws-mountpoint-s3-csi-driver.selectorLabels" . }}
{{- if ne .Release.Name "kustomize" }}
helm.sh/chart: {{ include "aws-s3-csi-driver.chart" . }}
helm.sh/chart: {{ include "aws-mountpoint-s3-csi-driver.chart" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -52,8 +52,8 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Common selector labels
*/}}
{{- define "aws-s3-csi-driver.selectorLabels" -}}
app.kubernetes.io/name: {{ include "aws-s3-csi-driver.name" . }}
{{- define "aws-mountpoint-s3-csi-driver.selectorLabels" -}}
app.kubernetes.io/name: {{ include "aws-mountpoint-s3-csi-driver.name" . }}
{{- if ne .Release.Name "kustomize" }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
Expand All @@ -62,7 +62,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{/*
Convert the `--extra-tags` command line arg from a map.
*/}}
{{- define "aws-s3-csi-driver.extra-volume-tags" -}}
{{- define "aws-mountpoint-s3-csi-driver.extra-volume-tags" -}}
{{- $result := dict "pairs" (list) -}}
{{- range $key, $value := .Values.controller.extraVolumeTags -}}
{{- $noop := printf "%s=%v" $key $value | append $result.pairs | set $result "pairs" -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: {{ .Values.node.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "aws-s3-csi-driver.labels" . | nindent 4 }}
{{- include "aws-mountpoint-s3-csi-driver.labels" . | nindent 4 }}
{{- with .Values.node.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"os"

"github.com/awslabs/aws-s3-csi-driver/pkg/driver"
"github.com/awslabs/mountpoint-s3-csi-driver/pkg/driver"
"k8s.io/klog/v2"
)

Expand Down
6 changes: 3 additions & 3 deletions deploy/kubernetes/base/node-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ apiVersion: apps/v1
metadata:
name: s3-csi-node
labels:
app.kubernetes.io/name: aws-s3-csi-driver
app.kubernetes.io/name: aws-mountpoint-s3-csi-driver
spec:
selector:
matchLabels:
app: s3-csi-node
app.kubernetes.io/name: aws-s3-csi-driver
app.kubernetes.io/name: aws-mountpoint-s3-csi-driver
template:
metadata:
labels:
app: s3-csi-node
app.kubernetes.io/name: aws-s3-csi-driver
app.kubernetes.io/name: aws-mountpoint-s3-csi-driver
spec:
nodeSelector:
kubernetes.io/os: linux
Expand Down
8 changes: 4 additions & 4 deletions docs/cluster_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ kubectl rollout restart daemonset s3-csi-node -n kube-system

### Helm
[IN DEVELOPMENT MODE] Change the image reference that you're deploying the driver image to to your personal private ECR repo in the values.yaml file.
Install the aws-s3-csi-driver
Install the aws-mountpoint-s3-csi-driver
```
helm upgrade --install aws-s3-csi-driver --namespace kube-system ./charts/aws-s3-csi-driver --values ./charts/aws-s3-csi-driver/values.yaml
helm upgrade --install aws-mountpoint-s3-csi-driver --namespace kube-system ./charts/aws-mountpoint-s3-csi-driver --values ./charts/aws-mountpoint-s3-csi-driver/values.yaml
```

### Verifying installation
Expand Down Expand Up @@ -140,7 +140,7 @@ kind: ServiceAccount
metadata:
name: s3-csi-driver-sa
labels:
app.kubernetes.io/name: aws-s3-csi-driver
app.kubernetes.io/name: aws-mountpoint-s3-csi-driver
app.kubernetes.io/managed-by: eksctl
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::151381207180:role/AmazonS3CSIDriverFullAccess # CHANGE THIS ARN
Expand All @@ -149,6 +149,6 @@ metadata:
### Helm
Uninstall the driver
```
helm uninstall aws-s3-csi-driver --namespace kube-system
helm uninstall aws-mountpoint-s3-csi-driver --namespace kube-system
```
Note: This will not delete the service account.
38 changes: 38 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Installation

## Prerequisites

* Kubernetes Version >= 1.20

* If you are using a self managed cluster, ensure the flag `--allow-privileged=true` for `kube-apiserver`.

## Installation
### Set up driver permissions
The driver requires IAM permissions to talk to Amazon S3 to manage the volume on user's behalf. AWS maintains a managed policy, available at ARN `arn:aws:iam::aws:policy/AmazonS3FullAccess`.

For more information, review ["Creating the Amazon Mountpoint for S3 CSI driver IAM role for service accounts" from the EKS User Guide.]

### Deploy driver
You may deploy the EBS CSI driver via Kustomize, Helm, or as an [Amazon EKS managed add-on].

### Kustomize

#### Kustomize
```sh
kubectl apply -k "github.com/awslabs/mountpoint-s3-csi-driver/deploy/kubernetes/overlays/stable"
```
*Note: Using the main branch to deploy the driver is not supported as the main branch may contain upcoming features incompatible with the currently released stable version of the driver.*

#### Helm
- Add the `aws-mountpoint-s3-csi-driver` Helm repository.
```sh
helm repo add aws-mountpoint-s3-csi-driver ???
helm repo update
```

- Install the latest release of the driver.
```sh
helm upgrade --install aws-mountpoint-s3-csi-driver \
--namespace kube-system \
aws-mountpoint-s3-csi-driver/aws-ebs-csi-driver
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/awslabs/aws-s3-csi-driver
module github.com/awslabs/mountpoint-s3-csi-driver

go 1.21

Expand Down
2 changes: 1 addition & 1 deletion pkg/cloud/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"testing"

"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/awslabs/aws-s3-csi-driver/pkg/cloud/mocks"
"github.com/awslabs/mountpoint-s3-csi-driver/pkg/cloud/mocks"
"github.com/golang/mock/gomock"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"net"

"github.com/awslabs/aws-s3-csi-driver/pkg/cloud"
"github.com/awslabs/aws-s3-csi-driver/pkg/util"
"github.com/awslabs/mountpoint-s3-csi-driver/pkg/cloud"
"github.com/awslabs/mountpoint-s3-csi-driver/pkg/util"
"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/grpc"
"k8s.io/klog/v2"
Expand Down
2 changes: 1 addition & 1 deletion pkg/driver/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io/fs"
"testing"

mock_driver "github.com/awslabs/aws-s3-csi-driver/pkg/driver/mocks"
mock_driver "github.com/awslabs/mountpoint-s3-csi-driver/pkg/driver/mocks"
csi "github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/mock/gomock"
"golang.org/x/net/context"
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e-kubernetes/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ function setup_kubeconfig() {
}

function ensure_driver_not_installed() {
if [[ $(helm list -A | grep aws-s3-csi-driver) == *deployed* ]]; then
helm uninstall aws-s3-csi-driver --namespace kube-system
if [[ $(helm list -A | grep aws-mountpoint-s3-csi-driver) == *deployed* ]]; then
helm uninstall aws-mountpoint-s3-csi-driver --namespace kube-system
sleep 10 # nice to have: a better way to wait for driver removed
fi
kubectl get pods -A
kubectl get CSIDriver
}

function install_driver() {
helm upgrade --install aws-s3-csi-driver --namespace kube-system ./charts/aws-s3-csi-driver --values \
./charts/aws-s3-csi-driver/values.yaml \
helm upgrade --install aws-mountpoint-s3-csi-driver --namespace kube-system ./charts/aws-mountpoint-s3-csi-driver --values \
./charts/aws-mountpoint-s3-csi-driver/values.yaml \
--set image.repository=${REGISTRY}/s3-csi-driver \
--set image.tag=${TAG} \
--set image.pullPolicy=Always
Expand Down
4 changes: 2 additions & 2 deletions tests/sanity/sanity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (

sanity "github.com/kubernetes-csi/csi-test/pkg/sanity"

"github.com/awslabs/aws-s3-csi-driver/pkg/driver"
"github.com/awslabs/aws-s3-csi-driver/pkg/util"
"github.com/awslabs/mountpoint-s3-csi-driver/pkg/driver"
"github.com/awslabs/mountpoint-s3-csi-driver/pkg/util"
)

const (
Expand Down

0 comments on commit 490d1be

Please sign in to comment.