GKEã®sentryã§filesã«GCSã使ã
Sentry(sentry:9.1.1-onbuild
)ãGKEä¸ã§æ§ç¯ãããã¨ããéã«filesãGCSã«ç½®ãããã£ãã®ã§èª¿ã¹ã¦ã¿ãã
9.1.1ã®imageã使ãã¨sentry.conf.pyã«ã¯ããã©ã«ãã§ã¯ä»¥ä¸ã®ããã«æ¸ããã¦ããã
################ # File storage # ################ # Uploaded media uses these `filestore` settings. The available # backends are either `filesystem` or `s3`. SENTRY_OPTIONS['filestore.backend'] = 'filesystem' SENTRY_OPTIONS['filestore.options'] = { 'location': env('SENTRY_FILESTORE_DIR'), }
ä¸è¨ã®ããã©ã«ãã§ã¯localã«ãã¡ã¤ã«ãç½®ãããããã«ãªã£ã¦ããããvolumeãå²ãå½ã¦ã¦ããæ¹æ³ã§ãåé¿ã§ããã ãã volumeãã¦ã³ãã¯ãéãé«ãã®ã§ãã¾ããããããªãã£ãã
s3ãæå®ã§ãããªãGCSããããã®ã§ã¯ï¼ã¨æã£ã¦èª¿ã¹ã¦ã¿ãã¨ã©ããããããã£ã½ãã 9.1.1ã«ãgcså¨ãã®ã½ã¼ã¹ãã¡ã¤ã«ã¯å ¥ã£ã¦ããããã ã£ãã®ã§è¨å®ããã ãã§è¡ãããã¨ãããã¨ã§è©¦ãã¦ã¿ãã
# Uploaded media uses these `filestore` settings. The available # backends are either `filesystem` or `s3`. SENTRY_OPTIONS['filestore.backend'] = 'gcs' SENTRY_OPTIONS['filestore.options'] = { 'bucket_name': env('SENTRY_FILES_BUCKET'), } ##############
è¨å®ãè¦ã¦ãããã¨ãããéããcredentialç³»ã®è¨å®ã¯ãã¦ããªãã®ã§SAçµç±ã§æ¨©é確èªããããããã GitHubä¸ã®ã³ã¼ãã確èªããã¨ä»¥ä¸ã®ããã«æ¸ããã¦ããã
# NOTE: See docs/filestore for instructions on configuring the shell environment # with authentication credentials for Google Cloud.
権éã¯GKEã®nodeã«ä¸ãã¦ãããåããã¦ã¿ãã¨ä»¥ä¸ã®ã¨ã©ã¼ãåºãã
Error importing module sentry.filestore.gcs: "No module named google.cloud.storage.client"
ã©ãããããã©ã«ãã§ã¯gcsé¢ä¿ã®ã©ã¤ãã©ãªãå ¥ã£ã¦ããªã模æ§ã sentryã®docker onbuildçã¯ã«ã¹ã¿ã ã¤ã¡ã¼ã¸ãç°¡åã«ä½ããããã«ãªã£ã¦ããã®ã§ä»¥ä¸ã®ããã«ãã¦gcsã®ã©ã¤ãã©ãªãå ¥ããã¤ã¡ã¼ã¸ãä½æã
ãã¡ã¤ã«æ§æ
sentry âââ Dockerfile âââ requirements.txt
Dockerfile
ARG TAG FROM sentry:${TAG}-onbuild
requirements.txt
google-cloud-storage>=1.13.2,<1.14
sentryãã£ã¬ã¯ããªã«å ¥ã£ã¦
docker build --build-arg TAG=9.1.1 -t sentry:9.1.1 -f Dockerfile .
ã¨ããã°gcsã®ã©ã¤ãã©ãªãå ¥ã£ã9.1.1ã®ã¤ã¡ã¼ã¸ãã§ããã®ã§GCRã®ã»ãã«ã¢ãããã¼ããã¦GKEãã使ãããã«ããã ãã®å¾ãsentryä¸ã§ãããã£ã¼ã«ãorganizationã®ç»åãé©å½ã«å¤æ´ããã¨GCSã«ã¡ããã¨ã¢ãããã¼ãã§ãããã¨ã確èªã
ããã§volumeã使ããå®ãç»åãæ°¸ç¶åã§ããããã«ãªã£ãã ãªãã ããã ãã£ã¦pv/pvcã®ç®¡çã¯å²ã¨é¢åãªã®ã§ä½¿ããªãã«è¶ãããã¨ã¯ãªãã